cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A256398 Palindromes of the form i^2 + reverse(i)^2.

Original entry on oeis.org

0, 2, 8, 101, 242, 404, 585, 909, 10001, 12221, 14841, 20402, 24642, 40004, 44244, 48884, 50805, 90009, 96269, 1000001, 1030301, 1080801, 1210121, 1244421, 1298921, 1440441, 1478741, 1690961, 2004002, 2234322, 2468642, 2484842, 4000004, 4050504, 4410144
Offset: 1

Views

Author

Bui Quang Tuan, Mar 28 2015

Keywords

Comments

Is 864666666468 the only term in this sequence that has an even number of digits? - Jon E. Schoenfield, Mar 30 2015
The next terms with an even number of digits are 5807785995877085, 56359464311346495365, and 943614966934439669416349, which are obtained for i = 37939066, 3553782166, 529145826418 (and their reverses). - Giovanni Resta, Aug 22 2025

Examples

			Palindrome 585 is in the sequence because 585 = 12^2 + 21^2.
The smallest term that can be obtained in more than one way is 125484521 = 11020^2 + 2011^2 = 11200^2 + 211^2. Are there any terms that can be obtained in more than two ways? - _Jon E. Schoenfield_, Mar 30 2015
		

Crossrefs

Cf. A002113 (palindromes), A056964 (n+rev(n)).
Cf. A256437.

Programs

  • Mathematica
    Sort@ DeleteDuplicates@ Select[Table[n^2 + FromDigits[Reverse[IntegerDigits@ n]]^2, {n, 10000}], Reverse@ IntegerDigits@ # == IntegerDigits@ # &] (* Michael De Vlieger, Mar 28 2015 *)
  • PARI
    rev(n)=r="";d=digits(n);for(i=1,#d,r=concat(Str(d[i]),r));eval(r)
    v=[];for(n=0,10^4,if(rev(P=(n^2+rev(n)^2))==P,v=concat(v,P)));vecsort(v,,8) \\ Derek Orr, Mar 29 2015

Extensions

Data corrected by Derek Orr, Mar 29 2015

A256495 Palindromes i such that 2*i^2 is a palindrome.

Original entry on oeis.org

0, 1, 2, 11, 101, 111, 1001, 1111, 10001, 10101, 11011, 100001, 101101, 110011, 1000001, 1001001, 1010101, 1100011, 10000001, 10011001, 10100101, 11000011, 100000001, 100010001, 100101001, 101000101, 110000011, 1000000001, 1000110001, 1001001001, 1010000101
Offset: 1

Views

Author

Bui Quang Tuan, Mar 31 2015

Keywords

Comments

Subsequence of palindromes of A256437.
The sequence contains all positive integers of the form: m*10^(i + NumberOfDigit(m)) + m where i is any nonnegative integer and m is any term of A000533.
Also contains 1 + 10^i and 1 + 10^i + 10^(2*i) for all i >= 1. Are there any members with more than four 1's, or any members other than 2 with digits other than 0's and 1's? - Robert Israel, Apr 13 2015

Examples

			Palindrome 11 is in the sequence because 2*11^2 = 242, a palindrome.
		

Crossrefs

Cf. A256437.

Programs

  • Maple
    dmax:= 11: # to get all terms with at most dmax digits
    revdigs:= proc(n)
      local L,i;
      L:= convert(n,base,10);
      add(10^(i-1)*L[-i],i=1..nops(L));
    end proc:
    filter:= proc(n) local L;
      L:= convert(2*n^2,base,10);
      L = ListTools:-Reverse(L)
    end proc:
    A:= {}:
    for d from 1 to dmax do
      if d::even then
         A:= A union select(filter, {seq(10^(d/2)*x + revdigs(x), x=10^(d/2-1)..10^(d/2)-1)})
      else
         m:= (d-1)/2;
         A:= A union select(filter, {seq(seq(10^(m+1)*x + y*10^m + revdigs(x), y=0..9),x=10^(m-1)..10^m-1)})
      fi
    od:
    A;  # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(A,list)); # Robert Israel, Apr 13 2015
  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Select[
    Range@ 10000000, palQ@ # && palQ[#^2 + FromDigits[Reverse@ IntegerDigits@ #]^2] &] (* Michael De Vlieger, Mar 31 2015 *)
    Select[Range[0,10101*10^5],AllTrue[{#,2#^2},PalindromeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 26 2020 *)
  • PARI
    ispal(n) = my(d = digits(n)); Vecrev(d) == d;
    lista(nn) = {for (n=0, nn, if (ispal(n) && ispal(2*n^2), print1(n, ", ")););} \\ Michel Marcus, Mar 31 2015

Extensions

a(19)-a(22) from Michel Marcus, Mar 31 2015
a(23)-a(31) from Lars Blomberg, Apr 13 2015
Showing 1-2 of 2 results.