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.

A330336 A322131/2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 105, 106, 107, 108, 109, 20, 21, 22, 23, 24, 205, 206, 207, 208, 209, 30, 31, 32, 33, 34, 305, 306, 307, 308, 309, 40, 41, 42, 43, 44, 405, 406, 407, 408, 409, 50, 51, 52, 53, 54, 505, 506, 507
Offset: 0

Views

Author

N. J. A. Sloane, Dec 17 2019

Keywords

Crossrefs

Cf. A322131.

Programs

  • Maple
    a:= n-> (s-> parse(cat(seq(parse(s[i])*2, i=1..length(s))))/2)(""||n):
    seq(a(n), n=0..70);  # Alois P. Heinz, Dec 18 2019
  • PARI
    a(n, base=10) = my (d=digits(n, base), v=0); for (i=1, #d, v = v*base^max(1, #digits(2*d[i], base)) + 2*d[i]); v/2 \\ Rémy Sigrist, Dec 18 2019

Formula

a(n) >= n with equality iff all the digits of the decimal representation of n, except possibly the first one, are in the range 0...4. - Rémy Sigrist, Dec 18 2019

A329147 Replace in n each nonzero digit d with prime(d).

Original entry on oeis.org

0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 20, 22, 23, 25, 27, 211, 213, 217, 219, 223, 30, 32, 33, 35, 37, 311, 313, 317, 319, 323, 50, 52, 53, 55, 57, 511, 513, 517, 519, 523, 70, 72, 73, 75, 77, 711, 713, 717, 719, 723, 110, 112, 113, 115, 117, 1111, 1113, 1117, 1119, 1123
Offset: 0

Views

Author

Bernard Schott, Nov 06 2019

Keywords

Comments

Some properties:
No term has a digit 4, 6 or 8.
No term begins with 9, 10, 12, 15, 29, 39, 59, 79.
If a is regarded as a function a: n --> a(n) from N to N, then
1) a is neither increasing: a(9) > a(10) nor decreasing: a(3) < a(4),
2) a is not injective: a(92) = a(122) = 233,
3) a is not surjective: 4 and 15 are not terms. The integers that are not in this sequence are in A329149 and the integers that are obtained are in A329150, with increasing order.
Some primes remain primes: 2, 3, 5, 7, 19, 59, ...
Some primes become composites: 11, 13, 17, 23, 29, 31, ...
Some composites remain composites: 10, 14, 16, 18, 20, 21, 22,...
Some composites become primes: 4, 6, 8, 9, 12, 15, 24, 25, 26,...
When n > 4 ends respectively with 0, 1 or 3 then a(n) that ends with 0, 2, 5 is composite.
The sequence 9, 99, 999, ..., respectively 12, 1212, 121212, ... generates the same numbers 23, 2323, 232323, ... Analogously, 9, 92, 922, 922, ... and 12, 122, 1222, ... generate the same sequence 23, 233, 2333, 23333, .... For the numbers 91,9191,919191, ... the terms of the sequence are 232, 232232, 232232232, ... so palindromes. - Marius A. Burtea, Nov 07 2019
The numbers 113, 14113, 1441113, 144411113, ... determine the terms 225 = 15^2, 27225 = 165^2, 2772225 = 1665^2, ... (in A191486). The numbers 14, 14000, 14000000, ... determine the terms 27 = 3^3, 27000 = 30^3, 27000000 = 300^3, .... - Marius A. Burtea, Nov 12 2019

Examples

			As a(2) = prime(2) = 3, a(5) = prime(5) = 11 and a(8) = prime(8) = 19, a(258)= 31119.
As a(3) = prime(3) = 5, a(0) = 0 and a(7) = prime(7) = 17, hence a(307) = 5017.
		

Crossrefs

Similar to A048380, A048385 and A322131.

Programs

  • Magma
    v:=[0,2,3,5,7,11,13,17,19,23]; [0] cat [StringToInteger(&cat[IntegerToString(k): k in Reverse([v[m+1]: m in Intseq(n)])]): n in [1..60]]; // Marius A. Burtea, Nov 07 2019
    
  • Maple
    a:= n-> (l-> parse(cat(seq(`if`(l[-i]=0, 0, ithprime(l[-i])),
                 i=1..nops(l)))))(convert(n, base, 10)):
    seq(a(n), n=0..80);  # Alois P. Heinz, Nov 07 2019
  • Mathematica
    p[n_] := If[n > 0, Prime[n], 0]; a[n_] := FromDigits[Flatten @ IntegerDigits @ (p /@ IntegerDigits[n])]; Array[a, 60, 0] (* Amiram Eldar, Nov 06 2019 *)
  • PARI
    a(n) = if (n, fromdigits(concat(apply(d -> if (d, digits(prime(d)), [0]), digits(n)))), 0) \\ Rémy Sigrist, Nov 07 2019
    
  • Python
    def A329147(n): return int("".join(map(str, ([0, 2, 3, 5, 7, 11, 13, 17, 19, 23][int(i)] for i in str(n)))))
    print([A329147(n) for n in range(60)]) # Michael S. Branicky, Apr 10 2023

A339023 Replace each digit d in the decimal representation of n with the digital root of n*d.

Original entry on oeis.org

0, 1, 4, 9, 7, 7, 9, 4, 1, 9, 10, 22, 36, 43, 52, 63, 76, 82, 99, 19, 40, 63, 88, 16, 36, 58, 73, 99, 28, 49, 90, 34, 61, 99, 31, 64, 99, 37, 67, 99, 70, 25, 63, 13, 55, 99, 46, 85, 36, 79, 70, 36, 85, 46, 99, 55, 13, 63, 25, 79, 90, 67, 37, 99, 64, 31, 99, 61
Offset: 0

Views

Author

Sebastian Karlsson, Jan 18 2021

Keywords

Examples

			a(23) = 16 because 2*23 = 46 and 3*23 = 69 and the digital roots of 46 and 69 are 1 and 6.
		

Crossrefs

Programs

  • PARI
    dr(n) = if(n, (n-1)%9+1); \\ A010888
    a(n) = if (n==0, return(0)); my(d=digits(n), s=""); for (k=1, #d, s=concat(s, dr(n*d[k]))); eval(s); \\ Michel Marcus, Jan 18 2021
  • Python
    def digitalroot(n):
        return 0 if n == 0 else (n-1)%9 + 1
    def a(n):
        return int(''.join([str(digitalroot(n*int(d))) for d in str(n)]))
    for n in range(0, 68):
        print(a(n), end=', ')
    

Formula

a(9*n + 1) = 9*n + 1.
a(10*n) = 10*a(n). - Sebastian Karlsson, Feb 14 2021

A348179 Replace each decimal digit d of n with the digit that is d steps to the right of d. Interpret the digits of n as a cycle: one step to the right from the last digit is considered to be the first.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 22, 31, 44, 51, 66, 71, 88, 91, 20, 22, 22, 22, 24, 22, 26, 22, 28, 22, 0, 13, 22, 33, 44, 53, 66, 73, 88, 93, 40, 44, 42, 44, 44, 44, 46, 44, 48, 44, 0, 15, 22, 35, 44, 55, 66, 75, 88, 95, 60, 66, 62, 66, 64, 66, 66, 66, 68, 66, 0, 17, 22, 37, 44, 57, 66, 77, 88, 97, 80, 88, 82, 88, 84, 88, 86, 88, 88, 88, 0, 19, 22, 39, 44, 59, 66, 79, 88, 99, 0, 1
Offset: 0

Views

Author

Sebastian Karlsson, Oct 05 2021

Keywords

Comments

First differs from A349422 at a(101). - Sebastian Karlsson, Dec 31 2021

Examples

			a(102345) = 004124 = 4124. For example, 4 gets replaced by 2 because moving 4 steps to the right gives: 4 -> 5 -> 1 -> 0 -> 2. Note that from 5 we went to the first digit of the number.
		

Crossrefs

Cf. A336668 (fixed points), A349422 (to the left), A349423 (index of first appearance of n).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a n = let s = show n; l = length s in
      read [s !! (mod (i + digitToInt (s !! i)) l) | i <- [0..l-1]] :: Integer
    
  • Mathematica
    Table[FromDigits@Table[v[[If[(p=Mod[k+v[[k]],t])==0,t,p]]],{k,t=Length[v=IntegerDigits[n]]}],{n,0,67}] (* Giorgos Kalogeropoulos, Oct 08 2021 *)
  • PARI
    f(k, d) = d[(k+d[k]-1)%#d + 1];
    a(n) = my(d=digits(n), dd=vector(#d, k, f(k, d))); fromdigits(dd); \\ Michel Marcus, Oct 07 2021
  • Python
    def a(n):
        s, l = str(n), len(str(n))
        return int("".join(s[(i + int(s[i])) % l] for i in range(l)))
    

Extensions

a(68)-a(101) from Sebastian Karlsson, Dec 31 2021

A341767 Replace each digit d in the decimal representation of n with the digital root of n^d.

Original entry on oeis.org

1, 4, 9, 4, 2, 9, 7, 1, 9, 11, 22, 39, 41, 54, 69, 71, 88, 99, 11, 41, 93, 77, 78, 99, 44, 11, 99, 11, 48, 91, 14, 87, 99, 17, 88, 99, 11, 84, 99, 41, 45, 99, 71, 11, 99, 11, 72, 99, 41, 21, 96, 44, 88, 99, 11, 51, 99, 77, 28, 91, 17, 11, 99, 11, 15, 99, 14
Offset: 1

Views

Author

Sebastian Karlsson, Feb 19 2021

Keywords

Comments

If n == 1 (mod 9), then every digit will be replaced by "1". If n == 0 (mod 9), then all nonzero digits will be replaced by "9".
The corresponding n of values a(n)= 1, a(n)= 11, a(n)= 111,... creates a subsequence of A236653. - Davide Rotondo, Mar 04 2024

Examples

			a(26) = 11, since 26^2 = 676 and 26^6 = 308915776. 6 + 7 + 6 = 19, 1 + 9 = 10 and 1 + 0 = 1, so the digital root of 676 is 1. 3 + 0 + 8 + 9 + 1 + 5 + 7 + 7 + 6 = 46, 4 + 6 = 10 and 1 + 0 = 1, so the digital root of 308915776 is 1. Thus, for 26, both "2" and "6" will be replaced by "1".
		

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits[Mod[n^IntegerDigits[n] - 1, 9] + 1]; Array[a, 100] (* Amiram Eldar, Feb 19 2021 *)
  • PARI
    dr(n) = if(n, (n-1)%9+1); \\ A010888
    a(n) = my(d=digits(n)); fromdigits(vector(#d, k, dr(n^d[k]))); \\ Michel Marcus, Feb 19 2021
  • Python
    def a(n):
        return int(''.join(str((pow(n, int(d), 9)-1)%9 + 1) for d in str(n)))
    

Formula

a(10*n) = 10*a(n) + 1.

A341953 Replace each digit d in the decimal representation of n with the digital root of d^n.

Original entry on oeis.org

1, 4, 9, 4, 2, 9, 7, 1, 9, 10, 11, 11, 19, 17, 18, 19, 14, 11, 19, 40, 81, 77, 59, 11, 25, 49, 81, 71, 59, 90, 91, 94, 99, 94, 92, 99, 97, 91, 99, 40, 71, 11, 49, 77, 18, 49, 74, 11, 49, 70, 81, 47, 29, 11, 55, 79, 81, 41, 29, 90, 91, 94, 99, 94, 92, 99, 97
Offset: 1

Views

Author

Sebastian Karlsson, Feb 24 2021

Keywords

Comments

The digits 0, 1, 3, 6 and 9 will always be replaced by the same digits: 0 -> 0, 1 -> 1, 3 -> 9, 6 -> 9 and 9 -> 9.

Examples

			a(14) = 17, since 1^14 = 1 and 4^14 = 268435456. 2 + 6 + 8 + 4 + 3 + 5 + 4 + 5 + 6 = 43 and 4 + 3 = 7. Thus, the digital root of 268435456 is 7. This means that for 14, "1" gets replaced by "1" and "4" gets replaced by "7".
		

Crossrefs

Programs

  • Mathematica
    digroot[n_] := If[n == 0, 0, Mod[n - 1, 9] + 1]; a[n_] := FromDigits[digroot /@ (IntegerDigits[n]^n)]; Array[a, 100] (* Amiram Eldar, Feb 24 2021 *)
  • PARI
    r(n) = if(n, (n-1)%9+1) \\ A010888
    a(n) = fromdigits(apply(x->r(x^n), digits(n))); \\ Michel Marcus, Mar 21 2021
  • Python
    def D(d, n):
        return 0 if d == 0 else (pow(d, n, 9)-1)%9 + 1
    def a(n):
        return int(''.join(str(D(int(d), n)) for d in str(n)))
    
Showing 1-6 of 6 results.