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 11-16 of 16 results.

A243589 Numbers returned when each binary digit of n is replaced by the sum modulo 2 of the digits to its (wrapped) left and (wrapped) right.

Original entry on oeis.org

0, 0, 0, 3, 5, 6, 0, 5, 15, 0, 10, 15, 5, 10, 0, 9, 27, 12, 30, 3, 17, 6, 20, 29, 15, 24, 10, 23, 5, 18, 0, 17, 51, 20, 54, 27, 57, 30, 60, 5, 39, 0, 34, 15, 45, 10, 40, 57, 27, 60, 30, 51, 17, 54, 20, 45, 15, 40, 10, 39, 5, 34, 0, 33, 99, 36, 102, 43, 105, 46
Offset: 1

Views

Author

Anthony Sand, Jun 07 2014

Keywords

Comments

a(n) = ror(n) XOR rol(n), where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left, and XOR is the binary exclusive-or operator. - Alex Ratushnyak, May 24 2016
Numbers returned by the following function: take the t binary digits of n, d(1)..d(t), and replace each with the sum d(i) = (d(i-1) + d(i+1)) mod 2, where (i-1 = 0) maps to t and (i+1 > t) maps to 1.

Examples

			For 1, the function returns d(1) = (d(1) + d(1)) mod 2 = (1 + 1) mod 2 = 0.
For 5, the initial digits are (1,0,1).
d(1) = (d(3) + d(2)) mod 2 = (1 + 0) mod 2 = 1; d(2) = (d(1) + d(3)) mod 2 = (1 + 1) mod 2 = 0; d(3) = (d(2) + d(1)) mod 2 = (0 + 1) mod 2 = 1.
The function returns (1,0,1) = 101 = 5 in base 10.
		

Crossrefs

Programs

  • Python
    for n in range(1, 100):
        BL = len(bin(n))-2
        x = (n>>1) + ((n&1) << (BL-1))   # A038572(n)
        x^= (n*2) - (1<A006257(n)  for n>0
        print(x, end=', ')

Formula

for digits d(1)..d(t), d(i) = (d(i-1) + d(i+1)) mod 2, where (i-1 = 0) -> t, (i+1 > t) -> 1.

A243590 Numbers returned when each digit of n is replaced by the sum modulo 10 of the digits to its (wrapped) left and (wrapped) right.

Original entry on oeis.org

2, 4, 6, 8, 0, 2, 4, 6, 8, 2, 22, 42, 62, 82, 2, 22, 42, 62, 82, 4, 24, 44, 64, 84, 4, 24, 44, 64, 84, 6, 26, 46, 66, 86, 6, 26, 46, 66, 86, 8, 28, 48, 68, 88, 8, 28, 48, 68, 88, 0, 20, 40, 60, 80, 0, 20, 40, 60, 80, 2, 22, 42, 62, 82, 2, 22, 42, 62, 82, 4, 24
Offset: 1

Views

Author

Anthony Sand, Jun 07 2014

Keywords

Comments

Numbers returned by the following function: take the t digits of n, d(1)..d(t), and replace each with the sum d(i) = (d(i-1) + d(i+1)) mod 10, where (i-1 = 0) maps to t and (i+1 > t) maps to 1.

Examples

			For 1, the function returns (1 + 1) mod 10 = 2.
For 5, the function returns (5 + 5) mod 10 = 0.
For 125, the initial digits are (1,2,5).
d(1) <- (d(3) + d(2)) mod 10 = (5 + 2) mod 10 = 7; d(2) <- (d(1) + d(3)) mod 10 = (1 + 5) mod 10 = 6; d(3) <- (d(2) + d(1)) mod 10 = (2 + 1) mod 10 = 3.
The function returns (7,6,3) = 763.
		

Crossrefs

Formula

for digits d(1)..d(t), d(i) = (d(i-1) + d(i+1)) mod 10, where (i-1 = 0) -> t, (i+1 > t) -> 1.

A345343 Numbers that yield a prime when any single digit is replaced by its digital complement.

Original entry on oeis.org

3, 5, 7, 8, 17, 33, 39, 47, 63, 71, 77, 93, 107, 171, 177, 221, 223, 287, 333, 339, 401, 441, 447, 699, 823, 827, 857, 883, 999, 1421, 1781, 2087, 2089, 2171, 2233, 2539, 3253, 3829, 3963, 4007, 4173, 4977, 5051, 5059, 5503, 5507, 6363, 7217, 7491, 7541, 8447, 10247
Offset: 1

Views

Author

Lamine Ngom, Jun 14 2021

Keywords

Comments

Digital complement of a digit d is 10-d if d > 0, 0 otherwise.

Examples

			3829 is a term since 7829, 3229, 3889 and 3821 are all primes.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := Module[{d = IntegerDigits[n]}, And @@ PrimeQ[Table[FromDigits[ReplacePart [d, i -> If[d[[i]] == 0, d[[i]], 10 - d[[i]]]]], {i, 1, Length[d]}]]]; Select[Range[10^4], q] (* Amiram Eldar, Jun 15 2021 *)
  • PARI
    f(x) = if (x, 10-x);
    isok(m) = {my(d=digits(m)); for (i=1, #d, d[i] = f(d[i]); if (!isprime(fromdigits(d)), return (0)); d[i] = f(d[i]);); return (1);} \\ Michel Marcus, Jun 15 2021
  • Python
    from sympy import isprime
    def comp(d, i): return d[:i] + str((10-int(d[i]))%10) + d[i+1:]
    def ok(n):
        d = str(n)
        return all(isprime(int(comp(d, i))) for i in range(len(d)))
    print(list(filter(ok, range(1, 11000)))) # Michael S. Branicky, Jun 14 2021
    

A300487 Numbers k whose 10's complement mod 10 of their digits is equal to phi(k), the Euler totient function of k.

Original entry on oeis.org

74, 834, 80940, 809400, 833334, 7414114, 7422694, 7539694, 8094000, 80940000, 809400000, 8094000000, 80940000000, 83335786566, 809400000000, 7539682539694, 8094000000000, 80940000000000
Offset: 1

Views

Author

Paolo P. Lava, Mar 07 2018

Keywords

Comments

Any number of the form 8094*10^j, with j>0, is part of the sequence because its Euler totient function is 2016*10^j.
Contains subsequence 834, 833334, 833333333333334, ... formed by numbers (10^k/4 + 2)/3 for k in A296059. - Max Alekseyev, Mar 09 2024

Examples

			phi(74) = 36 that is the 10's complement of the digits of 74.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,k,n;
    for n from 1 to q do a:=convert(phi(n),base,10);
    for k from 1 to nops(a) do a[k]:=(10-a[k]) mod 10; od; b:=0;
    for k from 1 to nops(a) do b:=b*10+a[nops(a)-k+1]; od;
    if b=n then print(n); fi; od; end: P(10^9);
  • PARI
    isok(x) = {my(dx = digits(x), dy = vector(#dx, k, (10-dx[k]) % 10)); fromdigits(dy) == eulerphi(x); } \\ Michel Marcus, Mar 12 2018

Extensions

a(11)-a(15) from Giovanni Resta, Mar 09 2018
a(16)-a(18) from Max Alekseyev, Mar 09 2024

A300796 Numbers x whose 10's complements y have the same sum of divisors of x, with x <> y.

Original entry on oeis.org

3762, 4125, 4865, 5135, 5875, 6238, 37620, 41250, 42825, 44571, 48650, 48839, 49496, 50504, 51161, 51350, 55429, 57175, 58750, 62380, 376200, 389232, 397584, 399441, 412500, 417864, 428250, 434355, 436185, 445710, 446369, 472535, 481325, 483662, 483792, 486500
Offset: 1

Views

Author

Paolo P. Lava, Mar 13 2018

Keywords

Comments

Many patterns can be found, e.g. 3762*10^j, 4125*10^j, 4865*10^j, 5135*10^j, 5875*10^j, 6238*10^j, etc.

Examples

			3762 is in the sequence because sigma(3762) = sigma(10^4-3762) = 9360.
5875 is in the sequence because sigma(5875) = sigma(10^4-5875) = 7488.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,n;
    for n from 1 to q do a:=10^(ilog10(n)+1)-n;
    if n<>a and sigma(n)=sigma(a) then print(n); fi; od; end: P(10^6);
  • Mathematica
    c10Q[n_]:=Module[{c=10^IntegerLength[n]-n},c!=n&&DivisorSigma[1,n] == DivisorSigma[1,c]]; Select[Range[500000],c10Q] (* Harvey P. Dale, Sep 24 2021 *)

A345529 Primes that yield a prime when any single digit is replaced by its 10's complement.

Original entry on oeis.org

3, 5, 7, 17, 47, 71, 107, 223, 401, 823, 827, 857, 883, 2087, 2089, 2539, 3253, 4007, 5051, 5059, 5503, 5507, 7541, 8447, 10247, 12401, 18041, 25303, 33529, 33589, 35533, 40427, 44171, 45557, 53503, 53653, 53899, 54401, 55001, 55009, 55333, 55817, 57077, 71147, 81017, 82003, 93553
Offset: 1

Views

Author

Lamine Ngom, Jun 20 2021

Keywords

Comments

Digital complement of a digit d is 10-d if d > 0, 0 otherwise.
Primes in A345343.

Examples

			71147 is a term since 31147, 79147, 71947, 71167 and 71143 are all primes.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := PrimeQ[n] && Module[{d = IntegerDigits[n]}, And @@ PrimeQ[Table[ FromDigits[ReplacePart[d, i -> If[d[[i]] == 0, d[[i]], 10 - d[[i]]]]], {i, 1, Length[d]}]]]; Select[Range[10^5], q] (* Amiram Eldar, Jul 06 2021 *)
  • Python
    from sympy import isprime, primerange
    def comp(d, i): return d[:i] + str((10-int(d[i]))%10) + d[i+1:]
    def ok(p):
        d = str(p)
        return all(isprime(int(comp(d, i))) for i in range(len(d)))
    print(list(filter(ok, primerange(1, 95000)))) # Michael S. Branicky, Jun 20 2021
Previous Showing 11-16 of 16 results.