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 34 results. Next

A235028 Fixed points of A235027.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 40, 42, 45, 48, 49, 50, 51, 54, 56, 60, 62, 63, 64, 68, 70, 72, 73, 75, 80, 81, 84, 85, 90, 93, 96, 98, 100, 102, 105, 107, 108, 112, 119, 120, 124, 125
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2014

Keywords

Comments

The first 20 terms are equal with A057890, after which a(21)=25, while A057890(21)=27. On the other hand, 33 is the first term which occurs in A057890 but does not occur here.
If terms x and y are included, then also their product x*y is included. If term x is included, then 2^k * x is also included. The sequence contains also all primes in A016041 and their mutual multiples. However, in addition to that, there are also terms like 143 = 11*13, where A235027 will map the factors to each other (as their binary expansions '1011' and '1101' are mirror images of each other), even although neither of them is present in A016041. (These latter kind of primes are in A074832).
Please use the "graph" link to see how the terms get rarer.

Crossrefs

The primes in this sequence: A016041.

A262628 Base-10 representation of 0 and the primes at A262627.

Original entry on oeis.org

0, 5, 1619, 22861, 5608661, 123097943, 2103004511, 411605194237, 29681120620523, 8356197277826743, 141511180168198879, 23016765965614427641, 30251327028834944270131, 371385619022538141977254297, 124784413675757116661951994259
Offset: 1

Views

Author

Clark Kimberling, Oct 02 2015

Keywords

Examples

			n   A262627(n)    base-10 representation
1   0                   0
2   101                 5
3   11001010011         1619
		

Crossrefs

Cf. A262627. Subsequence of A016041 (except a(1)).

Programs

  • Mathematica
    s = {0}; base = 2; z = 20; Do[NestWhile[# + 1 &, 1, ! PrimeQ[tmp = FromDigits[Join[#, IntegerDigits[Last[s]], Reverse[#]] &[IntegerDigits[#, base]], base]] &];
    AppendTo[s, FromDigits[IntegerDigits[tmp, base]]], {z}]; s  (* A262627 *)
    Map[FromDigits[ToString[#], base] &, s]  (* A262628 *)
    (* Peter J. C. Moses, Sep 01 2015 *)

A333424 Primes that are palindromes in primorial base.

Original entry on oeis.org

3, 7, 11, 31, 47, 211, 223, 229, 281, 293, 2311, 2347, 2383, 2843, 2879, 30091, 30181, 30211, 30307, 30367, 30427, 30493, 30553, 30643, 30829, 30859, 34871, 34961, 35051, 35117, 35267, 35363, 35393, 35423, 510751, 511711, 513067, 513307, 515143, 517459, 518179
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Examples

			3 is a term since it is a prime number and its representation in primorial base is 11 (1 * 2# + 1) which is a palindrome.
		

Crossrefs

Programs

  • Mathematica
    max = 8; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; Select[Range[nmax], PrimeQ[#] && PalindromeQ @ IntegerDigits[#, MixedRadix[bases]] &]

A342572 Positive numbers all of whose prime factors are binary palindromes.

Original entry on oeis.org

1, 3, 5, 7, 9, 15, 17, 21, 25, 27, 31, 35, 45, 49, 51, 63, 73, 75, 81, 85, 93, 105, 107, 119, 125, 127, 135, 147, 153, 155, 175, 189, 217, 219, 225, 243, 245, 255, 257, 279, 289, 313, 315, 321, 343, 357, 365, 375, 381, 405, 425, 441, 443, 459, 465, 511, 525, 527
Offset: 1

Views

Author

Amiram Eldar, Mar 27 2021

Keywords

Examples

			15 is a term since the binary representation of its prime factors, 3 and 5, are both palindromes: 11 and 101.
1 is a term because it has no prime factors, and "the empty set has every property". - _N. J. A. Sloane_, Jan 16 2022
		

Crossrefs

The binary version of A033620.
Subsequences: A016041, A329419.
Cf. A006995.

Programs

  • Mathematica
    seq[max_] := Module[{ps = Select[Range[max], PalindromeQ @ IntegerDigits[#, 2] && PrimeQ[#] &], s = {1}, s1, s2}, Do[p = ps[[k]]; emax = Floor@Log[p, max]; s1 = Join[{1}, p^Range[emax]]; s2 = Select[Union[Flatten[Outer[Times, s, s1]]], # <= max &]; s = Union[s, s2], {k, 1, Length[ps]}]; s]; seq[1000]
    Join[{1},Module[{bps=Select[Prime[Range[200]],IntegerDigits[#,2] == Reverse[ IntegerDigits[ #,2]]&]},Select[ Range[Max[ bps]],SubsetQ[ bps,FactorInteger[#][[All,1]]]&]]] (* Harvey P. Dale, Jan 16 2022 *)
  • Python
    from sympy import factorint
    def ispal(s): return s == s[::-1]
    def ok(n): return n > 0 and all(ispal(bin(f)[2:]) for f in factorint(n))
    print([k for k in range(528) if ok(k)]) # Michael S. Branicky, Jan 17 2022

Formula

Sum_{n>=1} 1/a(n) = Product_{p in A016041} p/(p-1) = 2.52136...

Extensions

"Positive" added to definition by N. J. A. Sloane, Jan 16 2022

A372141 Primes p that are palindromic in some prime base q, where q < p.

Original entry on oeis.org

3, 5, 7, 13, 17, 23, 31, 41, 67, 71, 73, 83, 107, 109, 127, 151, 157, 173, 199, 233, 257, 271, 277, 307, 313, 353, 379, 409, 419, 421, 431, 443, 457, 499, 521, 523, 571, 587, 599, 601, 631, 643, 647, 653, 691, 701, 709, 719, 733, 743, 757, 787, 797, 809, 823, 829, 857, 863, 887
Offset: 1

Views

Author

Tadayoshi Kamegai, Apr 20 2024

Keywords

Comments

If we remove either constraint of q < p or q being prime, then the sequence would be all prime numbers (A000040).
By definition it is a superset of A016041, and is a proper superset by construction (e.g., 13 is in the sequence).
Some terms have multiple bases that yield palindromic representations, the first being 31 (which is palindromic in both base 2 and base 5). The smallest prime p such that there exist n distinct primes less than p that give palindromic representations of p is A372142(n).

Examples

			11 is not in this sequence as its representation in base 2 is 1011, in base 3 is 102, in base 5 is 21, in base 7 is 14, none of which are palindromic.
1483 is in this sequence as its representation in base 37 is 131, which is palindromic.
		

Crossrefs

Programs

  • Mathematica
    a={}; For[i=1, i<=155, i++, flag=0; For[j=1, Prime[j] < Prime[i] && flag==0, j++, If[PalindromeQ[IntegerDigits[Prime[i], Prime[j]]], flag=1; AppendTo[a, Prime[i]]]]]; a (* Stefano Spezia, Apr 22 2024 *)
  • Python
    from sympy import sieve
    from sympy.ntheory import digits
    from itertools import islice
    def ispal(v): return v == v[::-1]
    def agen(): yield from (p for p in sieve if any(ispal(digits(p, q)[1:]) for q in sieve.primerange(1, p)))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Apr 20 2024

A373581 Prime numbers whose base-2 representation is a "nested" palindrome.

Original entry on oeis.org

3, 7, 31, 73, 127, 443, 1453, 5981, 8191, 19609, 21157, 28123, 29671, 83269, 131071, 262657, 287281, 324217, 354997, 367309, 431947, 456571, 462727, 499663, 524287, 1348901, 1488301, 1715851, 1875751, 5548693, 6298627, 7331323, 7355911, 8093551, 8191903
Offset: 1

Views

Author

James S. DeArmon, Jun 10 2024

Keywords

Comments

The definition of "nested" palindrome per A344550 is used: both the right and left halves of the base-2 representation of each term are themselves palindromes. "Half" means ceiling(m/2) for a m-bit term. (By contrast, A240601 uses floor(m/2).)

Examples

			Terms 1,2,and 3 are 3,7,31, with respective base-2 valuations of 11, 111, 11111. The fourth term, 73, is the smallest term containing zeros in the base-2 representation: 1001001. Note the middle bit is shared by both halves; the nested palindrome is "1001".
		

Crossrefs

Subsequence of A016041.
Primes in A373941.
Cf. A344550.

Programs

  • Python
    import sympy
    def ispal(n):
        return str(n) == str(n)[::-1]
    def isodd(n): return n%2
    outVec = []
    for n in range(9999999):
        if not sympy.isprime(n): continue
        binStr = (bin(n))[2:]
        if not ispal(binStr): continue
        lenB = len(binStr)
        halfB = int(lenB/2)
        if isodd(lenB): halfB += 1
        if not ispal(binStr[:halfB]): continue
        print(n,binStr)
        outVec.append(n)
    print(outVec)
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def pals(d, base=10): # returns a string
        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 nbp_gen(): # generator of nested binary palindromes (as strings)
        yield '0'
        for d in count(1):
            yield from (p+p[-1-d%2::-1] for p in pals((d+1)//2, base=2))
    def agen(): # generator of terms
        yield from filter(isprime, (int(nbp, 2) for nbp in nbp_gen()))
    print(list(islice(agen(), 36))) # Michael S. Branicky, Jun 12 2024
    (Common Lisp) ; See Links section.

A163170 Odd composite integers that are palindromes when written in binary.

Original entry on oeis.org

9, 15, 21, 27, 33, 45, 51, 63, 65, 85, 93, 99, 119, 129, 153, 165, 189, 195, 219, 231, 255, 273, 297, 325, 341, 365, 381, 387, 403, 427, 455, 471, 495, 511, 513, 561, 585, 633, 645, 693, 717, 765, 771, 819, 843, 891, 903, 951, 975, 1023, 1025, 1057, 1105, 1137
Offset: 1

Views

Author

Leroy Quet, Jul 22 2009

Keywords

Crossrefs

Cf. A016041.

Programs

  • Maple
    rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: a := proc (n) local n2: n2 := convert(n, binary): if 1 < n and `mod`(n, 2) = 1 and isprime(n) = false and rev(n2) = n2 then n else end if end proc: seq(a(n), n = 1 .. 1500); # Emeric Deutsch, Jul 24 2009
  • Mathematica
    Select[Range[1,1201,2],CompositeQ[#]&&IntegerDigits[#,2]==Reverse[IntegerDigits[#,2]]&] (* Harvey P. Dale, Dec 28 2024 *)

Extensions

Extended by Emeric Deutsch, Jul 24 2009

A168354 Squarefree semiprimes whose binary expansion is palindromic.

Original entry on oeis.org

15, 21, 33, 51, 65, 85, 93, 119, 129, 219, 341, 365, 381, 403, 427, 471, 511, 633, 717, 771, 843, 951, 1057, 1137, 1241, 1273, 1285, 1317, 1397, 1501, 1651, 1707, 1799, 1967, 2047, 2049, 2661, 2973, 3579, 3687, 3831, 4097, 4321, 4369, 4529, 4593, 4681
Offset: 1

Views

Author

Keywords

Examples

			15 = 3*5 = {1,1,1,1}.
21 = 3*7 = {1,0,1,0,1}.
33 = 3*11 = {1,0,0,0,0,1}.
		

Crossrefs

Cf. A016041.
Intersection of A006995 and A006881. - Michel Marcus, Nov 24 2020

Programs

  • Mathematica
    f1[n_]:=Reverse[IntegerDigits[n,2]]==IntegerDigits[n,2]; f2[n_]:=Last/@FactorInteger[n]=={1,1}; lst={};Do[If[f1[n]&&f2[n],AppendTo[lst,n]],{n,8!}];lst

A168355 Products of 3 distinct primes whose binary expansion is palindromic.

Original entry on oeis.org

165, 195, 231, 255, 273, 455, 561, 645, 903, 1023, 1105, 1533, 2015, 2193, 2289, 2409, 2553, 2829, 3171, 3219, 3435, 3855, 3999, 4161, 4433, 4953, 5285, 5397, 5621, 5709, 6141, 6307, 6643, 7163, 7239, 7511, 8481, 9417, 9705, 10245, 11805, 12093, 12291
Offset: 1

Views

Author

Keywords

Comments

All terms are odd. - Chai Wah Wu, Mar 28 2016

Examples

			165=3*5*11={1,0,1,0,0,1,0,1} 195=3*5*13={1,1,0,0,0,0,1,1}
		

Crossrefs

Cf. A016041.

Programs

  • Mathematica
    f1[n_]:=Reverse[IntegerDigits[n,2]]==IntegerDigits[n,2]; f2[n_]:=Last/@FactorInteger[n]=={1,1,1} lst={};Do[If[f1[n]&&f2[n],AppendTo[lst,n]],{n,8!}];lst

A346567 Fermat pseudoprimes to base 2 that are palindromic in base 2.

Original entry on oeis.org

341, 561, 645, 1105, 2047, 4369, 4681, 5461, 8481, 16705, 33153, 266305, 278545, 526593, 1052929, 1082401, 1398101, 2113665, 2162721, 2290641, 4259905, 6242685, 7674967, 8388607, 16843009, 17895697, 22369621, 34603041, 67371265, 268505089, 280885153, 285212689
Offset: 1

Views

Author

Amiram Eldar, Jul 23 2021

Keywords

Comments

There are 133 terms below 2^64. Only 4 of them are also Carmichael numbers (561, 1105, 278545 and 67371265).

Examples

			341 is a term since 341 = 101010101_2 is palindromic in base 2, it is composite (= 11 * 31) and 2^340 == 1 (mod 341).
		

Crossrefs

Intersection of A001567 and A006995.
A065341 and A281576 are subsequences.

Programs

  • Mathematica
    pspQ[n_] := CompositeQ[n] && PowerMod[2, n-1, n] == 1; Select[Range[10^6], PalindromeQ[IntegerDigits[#, 2]] && pspQ[#] &]
Previous Showing 21-30 of 34 results. Next