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!)
A280965 Nonsquares whose distances to the two nearest squares are squares. 1

%I #17 Feb 27 2017 11:40:07

%S 5,8,40,45,65,80,153,160,200,221,325,360,416,425,493,520,680,725,925,

%T 936,1025,1040,1073,1088,1305,1360,1768,1800,1813,1845,1961,2000,2320,

%U 2385,2501,2600,2925,3016,3185,3200,3400,3445,3848,3869,3944,3965,4640,4745,5185,5248,5265,5328,5525,5576,5785,5920,6120

%N Nonsquares whose distances to the two nearest squares are squares.

%C The sequence is infinite because there are terms of it between n^2 and (n+1)^2 whenever 2n+1 is a sum of two squares.

%H Charles R Greathouse IV, <a href="/A280965/b280965.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 40 because the two nearest squares are 36 and 49 and 40 - 36 = 4, 49 - 40 = 9 are both squares.

%t Select[Range[6120], IntegerQ[Sqrt[# - (Floor[Sqrt[#]])^2]] && IntegerQ[Sqrt[(Ceiling[Sqrt[#]])^2 - #]] &]

%o (PARI) is(n)=my(k=sqrtint(n)); issquare(n-k^2) && issquare((k+1)^2-n) && n>k^2 \\ _Charles R Greathouse IV_, Feb 27 2017

%o (PARI) list(lim)=my(v=List(),k2,K2,n); for(k=2,sqrtint(lim\1)-1, k2=k^2; K2=(k+1)^2; for(s=1,sqrtint(K2-k2-1), n=k2+s^2; if(issquare(K2-n), listput(v,n)))); k2=sqrtint(lim\1)^2; K2=(sqrtint(lim\1)+1)^2; for(n=k2+1,lim, if(issquare(n-k2) && issquare(K2-n), listput(v, n))); Vec(v) \\ _Charles R Greathouse IV_, Feb 27 2017

%Y Cf. A057653, A234334.

%K nonn

%O 1,1

%A _Emmanuel Vantieghem_, Feb 27 2017

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 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)