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.

Previous Showing 21-30 of 829 results. Next

A357045 Lexicographically earliest sequence of distinct non-palindromic numbers (A029742) such that a(n)+a(n+1) is always a palindrome (A002113).

Original entry on oeis.org

10, 12, 21, 23, 32, 34, 43, 45, 54, 47, 19, 14, 30, 25, 41, 36, 52, 49, 17, 16, 28, 27, 39, 38, 50, 51, 15, 18, 26, 29, 37, 40, 48, 53, 13, 20, 24, 31, 35, 42, 46, 65, 56, 75, 76, 85, 86, 95, 96, 106, 116, 126, 136, 146, 157, 105, 97, 64, 57, 74
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Sep 14 2022

Keywords

Comments

Conjecture: The sequence contains all non-palindromic numbers (A029742).

Crossrefs

Cf. A029742 (non-palindromes), A002113 (palindromes), A357044 (palindromes with non-palindromic sum of neighbors).

Programs

  • PARI
    A357045_first(n, U=[9], a=1)={vector(n, k, k=U[1]; until( is_A002113(a+k) && !is_A002113(k) && !setsearch(U, k), k++); U=setunion(U,[a=k]); while(#U>1 && U[2]==U[1]+1+is_A002113(U[1]+1), U=U[^1]); a)}
    
  • Python
    from itertools import count, islice
    def ispal(n): s = str(n); return s == s[::-1]
    def agen():
        aset, k, mink = {10}, 10, 12
        while True:
            an = k; yield an; aset.add(an); k = mink
            while k in aset or ispal(k) or not ispal(an+k): k += 1
            while mink in aset: mink += 1
    print(list(islice(agen(), 60))) # Michael S. Branicky, Sep 14 2022

A071278 Sorted list of numbers b(i)*b(j), 2 < i < j, where b = A002113 = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33 ... is a list of the decimal palindromes.

Original entry on oeis.org

6, 8, 10, 12, 12, 14, 15, 16, 18, 18, 20, 21, 22, 24, 24, 27, 28, 30, 32, 33, 35, 36, 40, 42, 44, 44, 45, 48, 54, 55, 56, 63, 66, 66, 66, 72, 77, 88, 88, 88, 99, 99, 110, 110, 132, 132, 132, 132, 154, 154, 165, 165, 176, 176, 176, 198, 198, 198, 198, 202, 220, 220, 222
Offset: 1

Views

Author

Amarnath Murthy, Jun 07 2002

Keywords

Comments

Old name was: Palindromes which are nontrivial multiples of 2 distinct palindromes.
Repetitions are allowed. 12 appears twice because it is both 2*6 and 3*4.

Examples

			8 is in the sequence because 8=2*4.
		

Crossrefs

Cf. A002113.

Programs

  • Mathematica
    Module[{nn=250,pals},pals=Select[Range[2,nn],PalindromeQ];Select[Sort[ Times@@#&/@ Subsets[pals,{2}]],#<=nn&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 27 2018 *)

Extensions

Corrected and extended by Sascha Kurz, Jan 02 2003
Edited (with corrected definition) by N. J. A. Sloane, May 27 2018

A099994 Bisection of A002113.

Original entry on oeis.org

0, 2, 4, 6, 8, 11, 33, 55, 77, 99, 111, 131, 151, 171, 191, 212, 232, 252, 272, 292, 313, 333, 353, 373, 393, 414, 434, 454, 474, 494, 515, 535, 555, 575, 595, 616, 636, 656, 676, 696, 717, 737, 757, 777, 797, 818, 838, 858, 878, 898, 919, 939, 959, 979, 999, 1111, 1331, 1551, 1771, 1991
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2004

Keywords

Programs

  • Mathematica
    r[n_]:=FromDigits[Reverse[IntegerDigits[n]]];v={}; Do[If[r[n]==n, v=Append[v, n]], {n, 0, 2200}];Table[v[[2k-1]], {k, Floor[Length[v]]/2}]

Extensions

Extended with Mathematica program by Farideh Firoozbakht, Dec 01 2004

A099995 Bisection of A002113.

Original entry on oeis.org

1, 3, 5, 7, 9, 22, 44, 66, 88, 101, 121, 141, 161, 181, 202, 222, 242, 262, 282, 303, 323, 343, 363, 383, 404, 424, 444, 464, 484, 505, 525, 545, 565, 585, 606, 626, 646, 666, 686, 707, 727, 747, 767, 787, 808, 828, 848, 868, 888, 909, 929, 949, 969, 989, 1001, 1221, 1441, 1661, 1881, 2002
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2004

Keywords

Programs

  • Mathematica
    r[n_]:=FromDigits[Reverse[IntegerDigits[n]]];v={}; Do[If[r[n]==n, v=Append[v, n]], {n, 0, 2200}];Table[v[[2k]], {k, Floor[Length[v]]/2}]

Extensions

Extended with Mathematica program by Farideh Firoozbakht, Dec 01 2004

A101034 Numbers n such that A002113(n) is a triangular number.

Original entry on oeis.org

0, 1, 3, 6, 14, 15, 26, 68, 75, 129, 158, 186, 249, 759, 1616, 1827, 2268, 2679, 4543, 6072, 6675, 7294, 13512, 16146, 27871, 112640, 116339, 152889, 161727, 239533, 260487, 404161, 670038, 685744, 767718, 973504, 2313206, 6250177, 6977617
Offset: 1

Views

Author

Klaus Brockhaus, Nov 27 2004

Keywords

Comments

Indices of triangular numbers in the sequence of palindromes.

Examples

			A002113(26) = 171 is a triangular number, so 26 is a term.
		

Crossrefs

Programs

Extensions

a(24) to a(38) from Klaus Brockhaus, Oct 05 2005

A110057 Number of solutions to x == 0 (mod A007954(x)), x in A002113, 10^(n-1) <= x < 10^n.

Original entry on oeis.org

9, 1, 2, 3, 7, 3, 6, 4, 9, 9, 18, 11, 24, 17, 25, 12, 45, 16, 53, 22
Offset: 1

Views

Author

Jean-Christophe Colin (colinjeanchristophe(AT)yahoo.fr), Sep 04 2005

Keywords

Crossrefs

Extensions

Edited by R. J. Mathar, Feb 08 2008
Offset changed to 1 and a(1) inserted by Jinyuan Wang, Jun 15 2022

A113614 Least number whose absolute difference of successive digits gives the n-th palindrome (A002113), or 0 if no such number exists.

Original entry on oeis.org

121, 131, 141, 151, 161, 171, 181, 191, 0, 1001, 1012, 1021, 1032, 1043, 1054, 1065, 1076, 1087, 1098, 0
Offset: 10

Views

Author

Amarnath Murthy, Nov 09 2005

Keywords

Comments

a(n) = 0 if n begins with 9 and contains odd number of digit. E.g., 919, 92129, etc. Are there other values of n for which a(n) = 0?
If n begins with 9 as a digit and contains even number of digits then a(n) is a palindrome.

Examples

			a(99) = 909.
a(191) = 1098. 1 - 0 = 1, abs(0 - 9) = 9, 9 - 8 = 1.
a(9119) = 90109.
		

Crossrefs

Cf. A002113.

A346919 Numbers that are both palindromes (A002113) and terms of A072389.

Original entry on oeis.org

0, 4, 252, 2112, 2772, 6336, 21012, 27072, 42924, 48384, 48984, 63036, 252252, 297792, 407704, 2327232, 2572752, 2747472, 2774772, 2958592, 4457544, 4811184, 6378736, 6396936, 25777752, 27633672, 29344392, 63099036, 63399336, 404080404, 409757904, 441525144
Offset: 1

Views

Author

Dumitru Damian, Aug 07 2021

Keywords

Crossrefs

Programs

  • Mathematica
    p[n_] :=  n*(n + 1); m = 1000; Select[Union[ Times @@@ Tuples[p /@ Range[0, m], {2}]], # <= 2*p[m] && PalindromeQ[#] &] (* Amiram Eldar, Aug 13 2021 *)
  • SageMath
    # the sequence numbers up to a limit
    def a346919_upto(lim, alst=set([0])):
        for i in range(1, int(lim**0.25)):
            for j in range(i, int((lim/(i*(i+1)))**0.5)+1):
                if all([(k:=i*(i+1)*j*(j+1))<=lim, str(k)==str(k)[::-1]]): alst.add(k)
        return sorted(alst)
    print(a346919_upto(10**9)) # Dumitru Damian, Apr 05 2023

Formula

Intersection of A072389 and A002113.
Intersection of 4*A085780 and A002113.

Extensions

More terms from Jinyuan Wang, Aug 07 2021

A353217 Triangular numbers (A000217) with arithmetic derivative (A003415) a palindrome (A002113).

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 136, 153, 231, 741, 1711, 11026, 22366, 99681, 104653, 593505, 1348903, 1378630, 1886653, 3098805, 4388203, 4474536, 24587578, 26626753, 32092066, 45825951, 132804253, 165283471, 197239591, 355657785, 498727153, 866008153, 1074091726, 1144165366
Offset: 1

Views

Author

Marius A. Burtea, Apr 30 2022

Keywords

Examples

			15 = A000217(5) and 15' = 8 = A002113(9), so 15 is a term.
153 = A000217(17) and 153' = 111 = A002113(21), so 153 is a term.
		

Crossrefs

Programs

  • Magma
    tr:=func; pal:=func; f:=func; [n:n in [d*(d+1) div 2:d in [0..150000]]| pal(Floor(f(n)))];
    
  • Mathematica
    d[0] = d[1] = 0; d[n_] := n*Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Table[n*(n + 1)/2, {n, 0, 50000}], PalindromeQ[d[#]] &] (* Amiram Eldar, Apr 30 2022 *)
  • Python
    from itertools import chain, count, islice
    from sympy import factorint
    def A353217_gen(): # generator of terms
        return chain((0,1),filter(lambda m:(s:=str(sum((m*e//p for p,e in factorint(m).items()))))[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],(n*(n+1)//2 for n in count(2))))
    A353217_list = list(islice(A353217_gen(),20)) # Chai Wah Wu, Jun 24 2022

A002385 Palindromic primes: prime numbers whose decimal expansion is a palindrome.

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, 10301, 10501, 10601, 11311, 11411, 12421, 12721, 12821, 13331, 13831, 13931, 14341, 14741, 15451, 15551, 16061, 16361, 16561, 16661, 17471, 17971, 18181, 18481, 19391, 19891, 19991
Offset: 1

Views

Author

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11, so 11 is the only member of the sequence with an even number of digits. - David Wasserman, Sep 09 2004
This holds in any number base A006093(n), n>1. - Lekraj Beedassy, Mar 07 2005 and Dec 06 2009
The log-log plot shows the fairly regular structure of these numbers. - T. D. Noe, Jul 09 2013
Conjecture: The only primes with palindromic prime indices that are palindromic primes themselves are 3, 5 and 11. Tested for the primes with the first 8000000 palindromic prime indices. - Ivan N. Ianakiev, Oct 10 2014
It follows from the above conjecture that 2 is the only k such that k, prime(k), prime(m) = k + prime(k) and m are all palindromic primes. - Ivan N. Ianakiev, Mar 17 2025
Banks, Hart, and Sakata derive a nontrivial upper bound for the number of prime palindromes n <= x as x -> oo. It follows that almost all palindromes are composite. The results hold in any base. The authors use Weil's bound for Kloosterman sums. - Jonathan Sondow, Jan 02 2018
Number of terms < 100^k, k >= 1: 5, 20, 113, 781, 5953, 47995, 401698, .... - Robert G. Wilson v, Jan 03 2018, corrected by M. F. Hasler, Dec 19 2024
Initially the above comment listed 4, 20, 113, ... which is the number of terms less than 10, 1000, 10^5, ..., i.e., up to 10^(2k-1), k >= 1. The number of terms < 10^k are the cumulative sums of A016115(n) (number of prime palindromes with n digits) up to n = k. - M. F. Hasler, Dec 19 2024

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 228.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 120-121.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A007500 = this sequence union A006567.
Subsequence of A188650; A188649(a(n)) = a(n); see A033620 for multiplicative closure. [Reinhard Zumkeller, Apr 11 2011]
Cf. A016041, A029732, A069469, A117697, A046942, A032350 (Palindromic nonprime numbers).
Cf. A016115 (number of prime palindromes with n digits).

Programs

  • GAP
    Filtered([1..20000],n->IsPrime(n) and ListOfDigits(n)=Reversed(ListOfDigits(n))); # Muniru A Asiru, Mar 08 2019
  • Haskell
    a002385 n = a002385_list !! (n-1)
    a002385_list = filter ((== 1) . a136522) a000040_list
    -- Reinhard Zumkeller, Apr 11 2011
    
  • Maple
    ff := proc(n) local i,j,k,s,aa,nn,bb,flag; s := n; aa := convert(s,string); nn := length(aa); bb := ``; for i from nn by -1 to 1 do bb := cat(bb,substring(aa,i..i)); od; flag := 0; for j from 1 to nn do if substring(aa,j..j)<>substring(bb,j..j) then flag := 1 fi; od; RETURN(flag); end; gg := proc(i) if ff(ithprime(i)) = 0 then RETURN(ithprime(i)) fi end;
    rev:=proc(n) local nn, nnn: nn:=convert(n,base,10): add(nn[nops(nn)+1-j]*10^(j-1),j=1..nops(nn)) end: a:=proc(n) if n=rev(n) and isprime(n)=true then n else fi end: seq(a(n),n=1..20000); # rev is a Maple program to revert a number - Emeric Deutsch, Mar 25 2007
    # A002385 Gets all base-10 palindromic primes with exactly d digits, in the list "Res"
    d:=7; # (say)
    if d=1 then Res:= [2,3,5,7]:
    elif d=2 then Res:= [11]:
    elif d::even then
        Res:=[]:
    else
        m:= (d-1)/2:
        Res2 := [seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1)]:
        Res:=[]: for x in Res2 do if isprime(x) then Res:=[op(Res),x]; fi: od:
    fi:
    Res; # N. J. A. Sloane, Oct 18 2015
  • Mathematica
    Select[ Prime[ Range[2100] ], IntegerDigits[#] == Reverse[ IntegerDigits[#] ] & ]
    lst = {}; e = 3; Do[p = n*10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[p], AppendTo[lst, p]], {n, 10^e - 1}]; Insert[lst, 11, 5] (* Arkadiusz Wesolowski, May 04 2012 *)
    Join[{2,3,5,7,11},Flatten[Table[Select[Prime[Range[PrimePi[ 10^(2n)]+1, PrimePi[ 10^(2n+1)]]],# == IntegerReverse[#]&],{n,3}]]] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Apr 22 2016 *)
    genPal[n_Integer, base_Integer: 10] := Block[{id = IntegerDigits[n, base], insert = Join[{{}}, {# - 1} & /@ Range[base]]}, FromDigits[#, base] & /@ (Join[id, #, Reverse@id] & /@ insert)]; k = 1; lst = {2, 3, 5, 7}; While[k < 19, p = Select[genPal[k], PrimeQ];
    If[p != {}, AppendTo[lst, p]]; k++]; Flatten@ lst (* RGWv *)
    Select[ Prime[ Range[2100]], PalindromeQ] (* Jean-François Alcover, Feb 17 2018 *)
    NestList[NestWhile[NextPrime, #, ! PalindromeQ[#2] &, 2] &, 2, 41] (* Jan Mangaldan, Jul 01 2020 *)
  • PARI
    is(n)=n==eval(concat(Vecrev(Str(n))))&&isprime(n) \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    forprime(p=2,10^5, my(d=digits(p,10)); if(d==Vecrev(d),print1(p,", "))); \\ Joerg Arndt, Aug 17 2014
    
  • PARI
    A002385_row(n)=select(is_A002113, primes([10^(n-1),10^n])) \\ Terms with n digits. For larger n, better filter primes in palindromes. - M. F. Hasler, Dec 19 2024
    
  • Python
    from itertools import chain
    from sympy import isprime
    A002385 = sorted((n for n in chain((int(str(x)+str(x)[::-1]) for x in range(1,10**5)),(int(str(x)+str(x)[-2::-1]) for x in range(1,10**5))) if isprime(n))) # Chai Wah Wu, Aug 16 2014
    
  • Python
    from sympy import isprime
    A002385 = [*filter(isprime, (int(str(x) + str(x)[-2::-1]) for x in range(10**5)))]
    A002385.insert(4, 11)  # Yunhan Shi, Mar 03 2023
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def A002385gen(): # generator of palprimes
        yield from [2, 3, 5, 7, 11]
        for d in count(3, 2):
            for last in "1379":
                for p in product("0123456789", repeat=d//2-1):
                    left = "".join(p)
                    for mid in [[""], "0123456789"][d&1]:
                        t = int(last + left + mid + left[::-1] + last)
                        if isprime(t):
                            yield t
    print(list(islice(A002385gen(), 46))) # Michael S. Branicky, Apr 13 2025
    
  • Sage
    [n for n in (2..18181) if is_prime(n) and Word(n.digits()).is_palindrome()] # Peter Luschny, Sep 13 2018
    

Formula

Intersection of A000040 (primes) and A002113 (palindromes).
A010051(a(n)) * A136522(a(n)) = 1. [Reinhard Zumkeller, Apr 11 2011]
Complement of A032350 in A002113. - Jonathan Sondow, Jan 02 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 25 2000
Comment from A006093 moved here by Franklin T. Adams-Watters, Dec 03 2009
Previous Showing 21-30 of 829 results. Next