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

A305719 Numbers whose squares have the same first and last digits.

Original entry on oeis.org

1, 2, 3, 11, 22, 26, 39, 41, 68, 75, 97, 101, 109, 111, 119, 121, 129, 131, 139, 141, 202, 208, 212, 218, 222, 225, 235, 246, 254, 256, 264, 303, 307, 313, 319, 321, 329, 331, 339, 341, 349, 351, 359, 361, 369, 371, 379, 381, 389, 391, 399, 401, 409, 411, 419, 421, 429, 431, 439, 441, 638
Offset: 1

Views

Author

Neville Holmes, Jun 08 2018

Keywords

Examples

			For k = 11, k^2 = 121;
for k = 26, k^2 = 676.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[638], (d = IntegerDigits[#^2]; d[[1]] == d[[-1]]) &] (* Giovanni Resta, Jun 25 2018 *)
  • PARI
    for(n=1, 10^3, my(d=digits(n^2)); if( d[1]==d[#d], print1(n,", "))); \\ Joerg Arndt, Jun 10 2018
    
  • Python
    def ok(n): s = str(n*n); return s[0] == s[-1]
    print(list(filter(ok, range(1, 639)))) # Michael S. Branicky, Jul 16 2021

A240601 Recursive palindromes in base 10: palindromes n where each half of the digits of n is also a recursive palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 606, 616, 626, 636, 646, 656, 666, 676, 686, 696, 707, 717, 727, 737, 747, 757, 767, 777, 787, 797, 808, 818, 828, 838, 848, 858, 868, 878, 888, 898, 909, 919, 929, 939, 949, 959, 969, 979, 989, 999, 1111
Offset: 1

Views

Author

Lior Manor, Apr 09 2014

Keywords

Comments

A number n with m digits in base 10 is a member if n is a palindrome, and the first floor(m/2) digits of n is already a previous term of a(n). All repdigit numbers are terms of a(n). Fast generation of new terms with 2m digits can be done by concatenating the previous terms with m digits twice. Fast generation of new terms with 2m+1 digits can be done by concatenating the previous terms with m digits twice with any single digit in the middle. The smallest palindrome which is not a member of a(n) is 1001.

Examples

			11011 is in the sequence since it is a palindrome of 5 digits, and the first floor(5/2) digits of it, 11, is also a term. 1001 and 10001 are not in the sequence since 10 is not in the sequence.
		

Crossrefs

Cf. A227858 (first difference is a(110) = 1111, but A227858(109) = 1001). - Georg Fischer, Oct 23 2018

Programs

  • Python
    from itertools import product
    def pals(d, base=10): # all d-digit palindromes as strings
      digits = "".join(str(i) for i in range(base))
      for p in product(digits, repeat=d//2):
        if d//2 > 0 and p[0] == "0": continue
        left = "".join(p); right = left[::-1]
        for mid in [[""], digits][d%2]: yield left + mid + right
    def auptod(dd):
      for d in range(1, dd+1):
        for p in pals(d//2):
          if d//2 == 0: p = ""
          elif p[0] == "0": continue
          for mid in [[""], "0123456789"][d%2]: yield int(p+mid+p[::-1])
    print([rp for rp in auptod(6)]) # Michael S. Branicky, May 22 2021

A077652 Primes whose initial and terminal decimal digits are identical.

Original entry on oeis.org

2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381, 1451, 1471, 1481, 1511, 1531, 1571, 1601, 1621, 1721, 1741, 1801, 1811
Offset: 1

Views

Author

Labos Elemer, Nov 19 2002

Keywords

Comments

1021 is the smallest of these not to be palindromic. - Jonathan Vos Post, Nov 02 2013
All palindromic primes (A002385) except 11 have an odd number of digits, therefore all terms > 11 with an even number of digits are non-palindromic in this sequence. - M. F. Hasler, Nov 02 2013

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(2000) | P[#P] eq P[1] where P is Intseq(p) ];  // Bruno Berselli, Jul 26 2011
    
  • Mathematica
    Do[s1=First[IntegerDigits[Prime[n]]]; s2=Last[IntegerDigits[Prime[n]]]; If[Equal[s1, s2], Print[Prime[n]]], {n, 1, 1000}]
    itdQ[n_]:=Module[{idn=IntegerDigits[n]},idn[[1]]==idn[[-1]]]; Select[Prime[ Range[ 500]], itdQ] (* Harvey P. Dale, Apr 12 2013 *)
  • PARI
    is(n)=digits(n)[1]==n%10&&isprime(n) \\ M. F. Hasler, Nov 02 2013

A342826 Numbers k such that d(1)^0 + d(2)^1 + ... + d(p)^(p-1) = d(1)^(p-1) + d(2)^(p-2) + ... + d(p)^0, where d(i), i=1..p, are the digits of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464
Offset: 1

Views

Author

Carole Dubois, Mar 23 2021

Keywords

Comments

This sequence starts off like other palindromic sequences such as A178354, A002113, A110751, and A227858 but it differs starting at the 110th term: 109th: 1001, 110th: 1011, 111th: 1101, ..., 119th: 1863, etc.
Differs from A297271 (which e.g. has 1021, 1031, 1041,.. 1091 which are absent here). - R. J. Mathar, Sep 27 2021
Contains the palindromes, and palindromes where pairs of digits have been substituted by d(i)=0, d(p-i)=1 or d(i)=1, d(p-1)=0, and "genuine" numbers like 1863, 2450, 2804, 2814, 3681, 4081, 4182, 103221, 113221, 122301, 122311, 142023,.. - R. J. Mathar, Sep 27 2021

Examples

			1863 is in this sequence because 1^0 + 8^1 + 6^2 + 3^3 = 1^3 + 8^2 + 6^1 + 3^0 = 72.
		

Crossrefs

Cf. A002113 (subset), A179309, A110751, A227858.

Programs

  • Maple
    isA342826 := proc(n)
        local dgs ;
        dgs := convert(n,base,10) ;
        if  add(op(i,dgs)^(i-1),i=1..nops(dgs)) = add(op(-i,dgs)^(i-1),i=1..nops(dgs)) then
            true;
        else
            false;
        end if;
    end proc:
    A342826 := proc(n)
        option remember ;
        if n =1 then
            1;
        else
            for a from procname(n-1)+ 1 do
                if isA342826(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Sep 27 2021
  • Mathematica
    Select[Range[500],Mod[#,10]!=0&&Total[IntegerDigits[#]^Range[0,IntegerLength[ #]-1]]==Total[IntegerDigits[#]^Range[IntegerLength[#]-1,0,-1]]&] (* Harvey P. Dale, Jan 18 2023 *)
  • Python
    def digpow(s): return sum(int(d)**i for i, d in enumerate(s))
    def aupto(limit):
      alst = []
      for k in range(1, limit+1):
        s = str(k)
        if digpow(s) == digpow(s[::-1]): alst.append(k)
      return alst
    print(aupto(464)) # Michael S. Branicky, Mar 23 2021

A272623 Fibonacci numbers whose first digit is equal to its last digit.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 55, 17711, 63245986, 165580141, 498454011879264, 14472334024676221, 1100087778366101931, 298611126818977066918552, 781774079430987230203437, 14028366653498915298923761, 22698374052006863956975682, 36726740705505779255899443, 59425114757512643212875125
Offset: 1

Views

Author

Chai Wah Wu, May 03 2016

Keywords

Crossrefs

Programs

  • Mathematica
    DeleteDuplicates@ Select[Fibonacci@ Range[0, 125], First@ # == Last@ # &@ IntegerDigits@ # &] (* Michael De Vlieger, May 04 2016 *)
  • PARI
    isok(n) = my(d = digits(n)); d[1] == d[#d];
    lista(nn) = print1(0, ", "); for (n=2, nn, if (isok(f=fibonacci(n)), print1(f, ", "))); \\ Michel Marcus, May 04 2016

A231278 Not necessarily palindromic primes of which initial and terminal digits are identical, as written in base 3.

Original entry on oeis.org

2, 111, 212, 1011, 1101, 1121, 2012, 2122, 10121, 10211, 11001, 11201, 12011, 12121, 12211, 20012, 20102, 20122, 21002, 21022, 22102, 22122, 22212, 101001, 101021, 101111, 102101, 102121, 110021, 110111, 110221, 111121, 111211, 112001, 112201, 120011, 120121
Offset: 1

Views

Author

Jonathan Vos Post, Nov 06 2013

Keywords

Comments

Base-3 analog of what A077652 is for base 10.

Examples

			a(3) = 212, which starts and ends with "2", and in base 3 means 2*(3^2) + 1*(3^1) + 2*(3^0) = 18 + 3 + 2 = 23 (base 10), which is prime.
		

Crossrefs

Programs

  • Mathematica
    FromDigits/@Select[IntegerDigits[#,3]&/@Prime[Range[100]],#[[1]]==#[[-1]]&] (* Harvey P. Dale, Oct 23 2022 *)

Extensions

More terms from Alois P. Heinz, Nov 07 2013
Showing 1-6 of 6 results.