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!)
A256435 First differences of sums of two squares. 1
1, 1, 2, 1, 3, 1, 1, 3, 3, 1, 1, 2, 5, 1, 3, 3, 2, 2, 1, 3, 1, 4, 4, 1, 2, 1, 5, 3, 3, 1, 3, 4, 1, 1, 6, 1, 1, 3, 4, 1, 7, 1, 2, 1, 3, 2, 3, 4, 3, 1, 4, 1, 3, 3, 2, 6, 1, 7, 1, 1, 2, 1, 4, 4, 3, 2, 2, 5, 1, 3, 5, 2, 1, 4, 8, 1, 2, 1, 3, 2, 3, 3, 4, 6, 3, 4, 1, 3, 3, 1, 1, 7, 1, 2, 1, 5, 6, 1, 3, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Sequence includes arbitrarily large values as well as infinitely many 1s.
LINKS
FORMULA
a(n) = A001481(n+1) - A001481(n).
MAPLE
b:= proc(n) option remember; local j, k;
for k from 1+`if`(n=1, -1, b(n-1)) do
for j from 0 to isqrt(iquo(k, 2)) do
if issqr(k-j^2) then return k fi
od od
end:
a:= n-> b(n+1)-b(n):
seq(a(n), n=1..100); # Alois P. Heinz, Mar 29 2015
MATHEMATICA
Select[Range[0, 1000], SquaresR[2, #] != 0&] // Differences (* Jean-François Alcover, Mar 28 2017 *)
PROG
(PARI) issum2sq(n) = my(fm=factor(n)); for(k=1, matsize(fm)[1], if(fm[k, 1]%4==3&&fm[k, 2]%2==1, return(0))); 1
al(n) = my(r=vector(n), j=0, k=0, last=0); while(k<n, if(issum2sq(j++), r[k++]=j-last; last=j)); r
(PARI) show(lim)=my(v=vectorsmall(lim\=1), u=List(), t=1); for(m=1, sqrtint(lim), for(n=1, sqrtint(lim-m^2), v[m^2+n^2]=1)); for(i=2, #v, if(v[i], listput(u, i-t); t=i)); Vec(u) \\ Charles R Greathouse IV, Mar 31 2015
CROSSREFS
Cf. A001481 (sums of 2 squares), A005408 (differences between squares).
Sequence in context: A006346 A244740 A088742 * A367412 A279945 A342724
KEYWORD
nonn
AUTHOR
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 19 18:00 EDT 2024. Contains 371797 sequences. (Running on oeis4.)