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.

User: Jeremias M. Gomes

Jeremias M. Gomes's wiki page.

Jeremias M. Gomes has authored 13 sequences. Here are the ten most recent ones:

A346408 Primes whose bitwise XOR of decimal digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 29, 31, 41, 43, 47, 61, 83, 103, 113, 131, 137, 139, 151, 157, 173, 193, 211, 223, 227, 233, 241, 263, 269, 277, 281, 311, 317, 337, 353, 367, 373, 379, 389, 397, 401, 409, 421, 443, 461, 467, 487, 557, 571, 577, 599, 601, 641, 647, 673, 683
Offset: 1

Author

Jeremias M. Gomes, Jul 21 2021

Keywords

Examples

			421 is a term because it is a prime whose bitwise XOR of digits is 7 which is also a prime.
		

Crossrefs

Cf. A000040, A346511 (XOR of digits of n).

Programs

  • Maple
    b:= l-> `if`(l=[], 0, Bits[Xor](l[1], b(subsop(1=[][], l)))):
    q:= n-> isprime(b(convert(n, base, 10))):
    select(q, [ithprime(i)$i=1..160])[];  # Alois P. Heinz, Jul 21 2021
  • Mathematica
    Select[Range[1000], PrimeQ[#] && PrimeQ[BitXor @@ IntegerDigits[#]] &] (* Amiram Eldar, Jul 21 2021 *)
  • Sage
    def XOR(a, b):
        return a ^^ b
    [n for n in (0..100) if (n in Primes() and reduce(XOR, map(lambda x: int(x), str(n))) in Primes())]

A346512 a(n) = bitwise XOR of decimal digits of primes.

Original entry on oeis.org

2, 3, 5, 7, 0, 2, 6, 8, 1, 11, 2, 4, 5, 7, 3, 6, 12, 7, 1, 6, 4, 14, 11, 1, 14, 0, 2, 6, 8, 3, 4, 3, 5, 11, 12, 5, 3, 4, 0, 5, 15, 8, 9, 11, 15, 1, 2, 3, 7, 9, 2, 8, 7, 6, 0, 7, 13, 4, 2, 11, 9, 8, 4, 3, 1, 5, 1, 7, 0, 14, 5, 15, 2, 7, 13, 8, 2, 13, 5, 13, 12
Offset: 1

Author

Jeremias M. Gomes, Jul 21 2021

Keywords

Examples

			a(10) = 2 XOR 9 = 11 as prime(10) = 29.
		

Crossrefs

Cf. A000040, A346408, A346511 (XOR of digits of n), A003987 (Table of n XOR m read by antidiagonals).

Programs

  • Maple
    b:= l-> `if`(l=[], 0, Bits[Xor](l[1], b(subsop(1=[][], l)))):
    a:= n-> b(convert(ithprime(n), base, 10)):
    seq(a(n), n=1..82);  # Alois P. Heinz, Jul 21 2021
  • Mathematica
    Table[BitXor @@ IntegerDigits[Prime[n]], {n, 1, 100}] (* Amiram Eldar, Jul 21 2021 *)
  • PARI
    a(n) = my(d=digits(prime(n)), k=0); for (i=1, #d, k= bitxor(k, d[i])); k; \\ Michel Marcus, Jul 21 2021
  • Sage
    def XOR(a, b):
      return a ^^ b
    [reduce(XOR, map(lambda x: int(x), str(p))) for p in (0..100) if p in Primes()]
    

Formula

a(n) = A346511(A000040(n)). - Mia Boudreau, Aug 06 2025

A346511 a(n) = bitwise XOR of decimal digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 5, 4, 7, 6, 1, 0, 3, 2, 13, 12, 6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 8, 9, 10
Offset: 0

Author

Jeremias M. Gomes, Jul 21 2021

Keywords

Examples

			a(5) = 5.
a(12) = 1 XOR 2 = 3.
a(425) = 4 XOR 2 XOR 5 = 3.
		

Programs

  • C
    char a(unsigned long long n){
     char p = 0;
     while (n > 0) {p ^= n % 10; n /= 10;}
     return p;}
     // Mia Boudreau, Aug 05 2025
  • Maple
    b:= l-> `if`(l=[], 0, Bits[Xor](l[1], b(subsop(1=[][], l)))):
    a:= n-> b(convert(n, base, 10)):
    seq(a(n), n=0..82);  # Alois P. Heinz, Jul 21 2021
  • Mathematica
    Table[BitXor @@ IntegerDigits[n], {n, 0, 100}] (* Amiram Eldar, Jul 21 2021 *)
  • PARI
    a(n) = my(d=digits(n), k=0); for (i=1, #d, k= bitxor(k, d[i])); k; \\ Michel Marcus, Jul 21 2021
    
  • Sage
    def XOR(a, b):
      return a ^^ b
    [reduce(XOR, map(lambda x: int(x), str(n))) for n in (0..1000)]
    

A338375 Number of digits in (2n)! / (2^n * n!).

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 18, 19, 21, 22, 24, 26, 27, 29, 31, 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 56, 58, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 104, 106, 108, 110
Offset: 1

Author

Jeremias M. Gomes, Oct 23 2020

Keywords

Comments

a(n) is the number of digits in double factorial of odd numbers (see A001147).

Examples

			For n = 7, (2*n-1)!! = 13!! = 135135 and the number of digits is 6.
		

Crossrefs

Programs

  • Maple
    seq(1 + ilog10(doublefactorial(2*n-1)), n=1..100); # Robert Israel, Jan 15 2024
  • Mathematica
    a[n_] := IntegerLength[(2 n - 1)!!]; Array[a, 65] (* Amiram Eldar, Oct 23 2020 *)
  • Sage
    floor((log(factorial(2 * n) / ((2 ** n) * factorial(n))) / log(10))) + 1

Formula

a(n) = floor(log((2n)!/((2^n)*n!))/log(10))+1.
a(n) = A055642(A001147(n)).

A308250 Squares of automorphic numbers in base 12 (cf. A201919).

Original entry on oeis.org

0, 1, 49, 64, 2401, 21904, 118336, 5764801, 1297152256, 22880797696, 149429406721, 3114293149696, 33232930569601, 2203546857570304, 3418922510231809
Offset: 1

Author

Jeremias M. Gomes, May 17 2019

Keywords

Examples

			2401 = c37_14 and sqrt(c37_14) = 37_14. Hence 2401 is in the sequence.
		

Crossrefs

Programs

  • Sage
    [(n * n) for n in (0..1000000) if (n * n).str(base = 14).endswith(n.str(base = 14))]

Formula

Equals A201919(n)^2.

A308249 Squares of automorphic numbers in base 12 (cf. A201918).

Original entry on oeis.org

0, 1, 16, 81, 4096, 6561, 263169, 1478656, 40960000, 205549569, 54988374016, 233605955584, 6263292059649, 303894740860929, 338531738189824, 170196776412774400, 709858175909625856, 18638643564726714369, 124592287100855910400, 2576097707358918017025, 479214351668445504864256
Offset: 1

Author

Jeremias M. Gomes, May 17 2019

Keywords

Comments

All terms k^2 in this sequence (except the trivials 0 and 1) have a square root k that is the suffix of one of the 12-adic numbers given by A259468 or A259469. From this, the sequence has an infinite number of terms. - A.H.M. Smeets, Aug 09 2019

Examples

			4096 = 2454_12 and sqrt(2454_12) = 54_12. Hence 4096 is in the sequence.
		

Crossrefs

Programs

  • Python
    dig = "0123456789AB"
    def To12(n):
        s = ""
        while n > 0:
            s, n = dig[n%12]+s, n//12
        return s
    n, m = 1, 0
    print(n,m*m)
    while n < 100:
        m = m+1
        m2, m1 = To12(m*m), To12(m)
        i, i2, i1 = 0, len(m2), len(m1)
        while i < i1 and (m2[i2-i-1] == m1[i1-i-1]):
            i = i+1
        if i == i1:
            print(n,m*m)
    n = n+1 # A.H.M. Smeets, Aug 09 2019
  • Sage
    [(n * n) for n in (0..1000000) if (n * n).str(base = 12).endswith(n.str(base = 12))]
    

Formula

Equals A201918(n)^2.

Extensions

Terms a(16)..a(21) from A.H.M. Smeets, Aug 09 2019

A308248 Squares of automorphic numbers in base 6 (cf. A237583).

Original entry on oeis.org

0, 1, 9, 16, 81, 784, 6561, 18496, 1478656, 43046721, 281165824, 893352321, 5859137025, 41368305664, 405026597889, 1088266240000, 15965210931201, 36991307874304, 583272781383681, 1318789102698496
Offset: 1

Author

Jeremias M. Gomes, May 17 2019

Keywords

Examples

			784 = 3344_6 and sqrt(3344_6) = 44_6. Hence 784 is in the sequence.
		

Crossrefs

Cf. A237583.

Programs

  • Sage
    [(n * n) for n in (0..1000000) if (n * n).str(base = 6).endswith(n.str(base = 6))]

Formula

a(n) = A237583(n)^2. - Michel Marcus, May 17 2019

A319598 Numbers in base 10 that are palindromic in bases 2, 4, 8, and 16.

Original entry on oeis.org

0, 1, 3, 5, 4095, 4097, 12291, 20485, 21845, 16777215, 16777217, 16781313, 50331651, 50343939, 83886085, 83906565, 89458005, 89478485, 68702703615, 68719476735, 68719476737, 68736258049, 206158430211, 206208774147, 343597383685, 343602954245, 343681290245
Offset: 1

Author

Jeremias M. Gomes, Sep 24 2018

Keywords

Comments

Intersection of A006995, A014192, A029803, and A029730.
This sequence is infinite because it contains terms of the forms 4096^k-1 (k>=0) and 4096^k+1 (k>0). - Bruno Berselli, Sep 24 2018

Examples

			4095 = 111111111111_2 = 333333_4 = 7777_8 = FFF_16. Hence 4095 is in the sequence.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), A029803 (base 8), and A029730 (base 16).

Programs

  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..100000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]

Extensions

a(19)-a(27) from Rémy Sigrist, Nov 15 2018

A319609 Numbers in base 10 that are palindromic in bases 4, 8 and 16.

Original entry on oeis.org

0, 1, 2, 3, 5, 170, 4095, 4097, 8194, 12291, 20485, 21845, 696490, 699050, 16777215, 16777217, 16781313, 16785409, 16789505, 33554434, 33558530, 33562626, 33566722, 50331651, 50335747, 50339843, 50343939, 83886085, 83906565, 89458005, 89478485
Offset: 1

Author

Jeremias M. Gomes, Sep 24 2018

Keywords

Examples

			170 = 2222_4 = 252_8 = AA_16. Hence 170 is in the sequence.
		

Crossrefs

Intersection of A014192, A029803 and A029730.

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 8) eq Reverse(Intseq(n, 8)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..100000) if Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
    

A319585 Numbers in base 10 that are palindromic in bases 2, 8, and 16.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 3951, 4095, 4097, 12291, 20485, 21845, 28679, 30039, 36873, 16187247, 16777215, 16777217, 16781313, 50331651, 50343939, 83886085, 83894277, 83906565, 83914757, 89458005, 89466197, 89478485, 89486677, 117440519, 117448711, 117460999
Offset: 1

Author

Jeremias M. Gomes, Sep 23 2018

Keywords

Comments

Intersection of A006995, A029803, and A029730.

Examples

			16187247 = 111101101111111101101111_2 = 75577557_8 = F6FF6F_16.
		

Crossrefs

Cf. A006995 (base 2), A029803 (base 8), and A029730 (base 16).

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 8) eq Reverse(Intseq(n, 8)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..10000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]