# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a256435
Showing 1-1 of 1
%I A256435 #25 Jul 27 2024 16:15:30
%S A256435 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,
%T A256435 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,
%U A256435 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
%N A256435 First differences of sums of two squares.
%C A256435 Sequence includes arbitrarily large values as well as infinitely many 1s.
%H A256435 Alois P. Heinz, Table of n, a(n) for n = 1..20000
%H A256435 R. P. Bambah and S. Chowla, On numbers which can be expressed as a sum of two squares. Proc. Nat. Inst. Sci. India (1947), 101-103.
%H A256435 Rainer Dietmann, Christian Elsholtz, Alexander Kalmynin, Sergei Konyagin, James Maynard, Longer Gaps Between Values of Binary Quadratic Forms, International Mathematics Research Notices, Volume 2023, Issue 12, June 2023, Pages 10313-10349.
%H A256435 P. Erdös, Some problems and results in elementary number theory, Publ. Math. Debrecen (1951), 103-109.
%H A256435 Ian Richards, On the gaps between numbers which are sums of two squares, Adv. in Math. (1982), 1-2.
%F A256435 a(n) = A001481(n+1) - A001481(n).
%p A256435 b:= proc(n) option remember; local j, k;
%p A256435 for k from 1+`if`(n=1, -1, b(n-1)) do
%p A256435 for j from 0 to isqrt(iquo(k, 2)) do
%p A256435 if issqr(k-j^2) then return k fi
%p A256435 od od
%p A256435 end:
%p A256435 a:= n-> b(n+1)-b(n):
%p A256435 seq(a(n), n=1..100); # _Alois P. Heinz_, Mar 29 2015
%t A256435 Select[Range[0, 1000], SquaresR[2, #] != 0&] // Differences (* _Jean-François Alcover_, Mar 28 2017 *)
%o A256435 (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
%o A256435 al(n) = my(r=vector(n),j=0,k=0,last=0); while(k