login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A034175 a(n) is minimal such that a(n)+a(n-1) is a square and a(n) is not in {a(0), ..., a(n-1)}. 10
0, 1, 3, 6, 10, 15, 21, 4, 5, 11, 14, 2, 7, 9, 16, 20, 29, 35, 46, 18, 31, 33, 48, 52, 12, 13, 23, 26, 38, 43, 57, 24, 25, 39, 42, 22, 27, 37, 44, 56, 8, 17, 19, 30, 34, 47, 53, 28, 36, 45, 55, 66, 78, 91, 105, 64, 80, 41, 40, 60, 61, 83, 86, 58, 63, 81, 88, 108, 117, 79, 65 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Conjectured to be a permutation of the nonnegative integers.
LINKS
Zak Seidov and P. Pein, Table of n, a(n) for n = 0..10000
Ely Golden, Python program
MAPLE
N:= 1000: # to go up to the first term > N
B:= Vector(N):
a[0]:= 0:
found:= true:
for n from 1 while found do
found:= false:
for k from floor(sqrt(a[n-1]))+1 do
b:= k^2 - a[n-1];
if b > N then a[n]:= b; break fi;
if B[b] = 0 then
found:= true;
a[n]:= b;
B[b]:= 1;
break
fi
od
od:
seq(a[i], i=0..n-1); # Robert Israel, Jun 02 2015
MATHEMATICA
a[ 0 ]=b[ 0 ]=0; lst={0}; For[ n=1, n<250, n++, For[ s=Ceiling[ Sqrt[ a[ n-1 ] ] ], MemberQ[ lst, s^2-a[ n-1 ] ], s++, Null ]; b[ a[ n ]=s^2-a[ n-1 ] ]=n; AppendTo[ lst, a[ n ] ] ]; Table[ a[ n ], {n, 0, 100} ]
(* Second program: *)
lst = {}; f[s_List] := Block[{k = 1, l = s[[ -1]]}, While[ MemberQ[s, k] || !IntegerQ@ Sqrt[k + l], k++ ]; AppendTo[lst, k]]; Nest[f, lst, 100] (* Robert G. Wilson v, May 09 2010 *)
PROG
(PARI) my(v=List(0), vs = vecsort(Vec(v)), n=1); while(n<50, if(issquare(v[#v]+n) && !vecsearch(vs, n), listput(v, n); vs = vecsort(Vec(v)); n=0); n++); Vec(v) \\ Derek Orr, Jun 01 2015; edited by Michel Marcus, Jan 04 2022
CROSSREFS
Sequence in context: A109443 A138777 A096895 * A361670 A368825 A306698
KEYWORD
nonn,easy,nice
AUTHOR
Dean Hickerson, Oct 01 1998
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:15 EDT 2024. Contains 371969 sequences. (Running on oeis4.)