Is this the kind of thing you want:

I've used pgfplots
in a standalone
file as follows
% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\foreach \n in {3,4,...,30}
{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=30,
ymin=-1.2,ymax=1.2]
\addplot[samples at={1,2,...,\n},only marks]expression{sin(deg(pi*sqrt{x^2+x}))};
\end{axis}
\end{tikzpicture}
}
\end{document}
And then used the command
convert -delay 10 -loop 0 -density 300 myfile.pdf myfile.gif
with ImageMagick installed. You'll see this technique demonstrated in a few other answers on the site- How to convert pstricks animation to GIF file? for example.
If you plan to have a lot of these animations, then you might like to make an arara
rule, something like the following
!config
# Make animated .gif file from .pdf
# author: Chris Hughes
# last edited by: cmh, May 25th 2013
# requires arara 3.0+
#
# Sample usage:
#
# % arara: animate
# % arara: animate: {density: 200}
# % arara: animate: {density: 200, delay: 20}
#
# This rule is really just a shortcut for commands like the following
#
# convert -delay 10 -loop 0 -density 300 myfile.pdf myfile.gif
#
# which will output myfile.gif
#
identifier: animate
name: animate
commands:
- <arara> convert -delay @{delay} -loop @{loop} -density @{density} "@{ getBasename(file) }.pdf" "@{ getBasename(file) }.gif"
arguments:
- identifier: delay
flag: <arara> @{parameters.delay}
default: 10
- identifier: loop
flag: <arara> @{parameters.loop}
default: 0
- identifier: density
flag: <arara> @{parameters.density}
default: 300