|
|
A233007
|
|
Numbers k such that (k-1)^2 + k^2 + (k+1)^2 is a palindrome.
|
|
0
|
|
|
0, 1, 5, 12, 38, 567, 1737, 8340, 16085, 17553, 17933, 36998, 40442, 119812, 173737, 378812, 1328121, 1751497, 1775707, 4427781, 8211880, 17909283, 40439558, 441564381, 828223250, 5602945243, 8227749490, 12900321392, 16028474345, 17552348197, 37196982752
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Indices of the palindromes in A005918.
|
|
LINKS
|
|
|
EXAMPLE
|
567 is in the sequence because 566^2 + 567^2 + 568^2 = 964469 is a palindrome.
|
|
MATHEMATICA
|
palindromeQ[n_] := (id = IntegerDigits[n]) === Reverse[id]; Reap[For[n = 0, n < 10^9, n++, If[palindromeQ[(n-1)^2 + n^2 + (n+1)^2], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Dec 03 2013 *)
Select[Range[0, 10^6], PalindromeQ[(#-1)^2+#^2+(#+1)^2]&] (* The program generates the first 16 terms of the sequence. To generate more, increase the Range constant. *) (* Harvey P. Dale, Feb 15 2022 *)
|
|
PROG
|
(PARI) isok(n) = v = Vec(Str((n-1)^2 + n^2 + (n+1)^2)); v == Vecrev(v); \\ Michel Marcus, Dec 03 2013
(Python)
a = 0
while a < 10000000000:
....q = (a-1)**2 + a**2 + (a+1)**2
....if str(q) == str(q)[::-1]:
........print(a, q)
....a+=1
(Magma) [n: n in [0..2*10^7] | Intseq(3*n^2+2, 10) eq Reverse(Intseq(3*n^2+2, 10))]; // Vincenzo Librandi, Jul 17 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|