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!)
A234335 Numbers k such that distances from k to three nearest squares are three perfect squares. 2
0, 5, 65, 160, 325, 1025, 2501, 5185, 5525, 7200, 9605, 16385, 26245, 40001, 40885, 58565, 82945, 93925, 97920, 114245, 153665, 160225, 187200, 202501, 204425, 219385, 262145, 334085, 419905, 430625, 521285, 640001, 707200, 777925, 781625, 869465, 937025, 972725 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A subsequence of A234334.
LINKS
EXAMPLE
5 is in the sequence because the following three are perfect squares: 5-4=1, 5-1=4, 9-5=4.
65 is in the sequence because the following three are perfect squares: 65-64=1, 65-49=16, 81-65=16, where 49, 64, 81 are the three squares nearest to 65.
PROG
(C)
#include <stdio.h>
#include <math.h>
typedef unsigned long long U64;
U64 isSquare(U64 a) {
U64 r = sqrt(a);
return r*r==a;
}
int main() {
for (U64 n=0; ; ++n) {
U64 r = sqrt(n);
if (r*r==n && n) --r;
if (isSquare(n-r*r) && isSquare((r+1)*(r+1)-n)) {
U64 rp = (r+2)*(r+2)-n;
r = n-(r-1)*(r-1);
if (n<=1 || rp<r) r = rp;
if (isSquare(r)) printf("%llu, ", n);
}
}
return 0;
}
CROSSREFS
Sequence in context: A266962 A126955 A091105 * A071902 A211412 A052199
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Dec 23 2013
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 23 06:58 EDT 2024. Contains 371906 sequences. (Running on oeis4.)