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-3 of 3 results.

A216446 Palindromic numbers which can be written as the sum of two or more consecutive squares.

Original entry on oeis.org

5, 55, 77, 181, 313, 434, 505, 545, 595, 636, 818, 1001, 1111, 1441, 1771, 4334, 6446, 17371, 17871, 19691, 21712, 41214, 42924, 44444, 46564, 51015, 65756, 81818, 97679, 99199, 108801, 127721, 137731, 138831, 139931, 148841, 161161, 166661, 171171, 188881
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Examples

			636 is in the sequence because it is a palindrome and 636 = 4^2+5^2+6^2+7^2+8^2+9^2+10^2+11^2+12^2.
		

Crossrefs

Cf. A034705, A180436, A267600 (terms with more than one representation).

Programs

  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; upto = 10^6; Union[ Reap[ For[i=1, s=i^2 + (i+1)^2; s < upto, i++, For[j=i+1, s < upto, j++; s += j^2, If[palQ[s], Sow@ s]]]][[2, 1]]] (* Giovanni Resta, Jun 14 2018 *)
    With[{nn=200},Select[Union[Flatten[Table[Total/@Partition[Range[nn]^2,n,1],{n,2,nn}]]],PalindromeQ]] (* Harvey P. Dale, Oct 17 2021 *)

Extensions

Errors in previous b-file noticed by Riley Waugh, Jun 13 2018

A267600 Palindromic numbers which are sum of consecutive squares in more than one way.

Original entry on oeis.org

554455, 9343439, 923222222329
Offset: 1

Views

Author

Chai Wah Wu, Jan 18 2016

Keywords

Comments

A subsequence of A180436.
a(4) > 10^18, if it exists. - Giovanni Resta, Jun 14 2018

Examples

			554455 = 9^2 + ... + 118^2 = 331^2 + ... + 335^2.
9343439 = 102^2 + ... + 307^2 = 657^2 + ... + 677^2.
923222222329 = 2967^2 + ... + 14087^2 = 42462^2 + ... + 42967^2.
		

Crossrefs

Cf. A180436.

A364143 a(n) is the minimal number of consecutive squares needed to sum to A216446(n).

Original entry on oeis.org

2, 5, 3, 2, 2, 3, 10, 2, 7, 9, 12, 11, 6, 11, 14, 3, 11, 29, 14, 7, 23, 4, 49, 8, 24, 5, 17, 12, 38, 46, 27, 34, 6, 14, 22, 66, 11, 66, 14, 11, 6, 77, 36, 63, 96, 11, 50, 3, 19, 96, 52, 41, 66, 33, 11, 3, 14, 121, 66, 89, 34, 127, 51, 2, 86, 54, 181, 48, 8
Offset: 1

Views

Author

DarĂ­o Clavijo, Jul 10 2023

Keywords

Examples

			a(8) = 7 is because 7 consecutive squares are needed to sum to A216446(8) = 595 = 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2.
		

Crossrefs

Programs

  • Python
    is_palindrome = lambda n: str(n) == str(n)[::-1]
    def g(L):
      L2, squares, D = L*L, [x*x for x in range(0, L + 1)], {}
      for i in range(1, L + 1):
        for j in range(i + 1, L + 1):
          candidate = sum(squares[i:j+1])
          if candidate < L2 and is_palindrome(candidate):
            if candidate in D:
              D[candidate]= min(D[candidate], j-i-1)
            else:
              D[candidate] = j-i+1
      return [D[k] for k in sorted(D.keys())]
    print(g(1000))
Showing 1-3 of 3 results.