login
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
OFFSET
1,3
COMMENTS
Indices of the palindromes in A005918.
LINKS
Erich Friedman, What's Special About This Number? (See entries 1737, 8340.)
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
# David Consiglio, Jr., Sep 12 2014
(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
Sequence in context: A162269 A028322 A169588 * A221795 A092772 A164737
KEYWORD
nonn,base
AUTHOR
Bruno Berselli, Dec 03 2013
EXTENSIONS
a(24)-a(25) from Jean-François Alcover, Dec 03 2013
a(26)-a(27) from David Consiglio, Jr., Sep 12 2014
a(28)-a(31) from Lars Blomberg, Jan 04 2016
STATUS
approved