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-5 of 5 results.

A336669 a(n) is the number of n-digit terms in A336668 (assuming 0 has 0 digit).

Original entry on oeis.org

1, 9, 25, 54, 93, 24, 192, 72, 464, 606, 40, 9, 302, 9, 88, 69, 464, 9, 1056, 9, 108, 117, 25, 9, 775, 24, 25, 606, 156, 9, 207, 9, 464, 54, 25, 87, 1166, 9, 25, 54, 479, 9, 255, 9, 93, 621, 25, 9, 775, 72, 40, 54, 93, 9, 1056, 24, 527, 54, 25, 9, 317, 9, 25
Offset: 0

Views

Author

Rémy Sigrist, Jul 29 2020

Keywords

Comments

This sequence is bounded as the decimal representation of any term in A336668 is fully determined by at most 9 of its leading digits.

Examples

			For n = 2:
- let m be a two-digit term of A336668 (10 <= m <= 99),
- if m starts with an odd digit, say d = 1, 3, 5, 7 or 9, then m ends with d,
- if m starts with an even digit, say d = 2, 4, 6 or 8, then m ends with any even digit, say t = 0, 2, 4, 6 or 8,
- so a(2) = 5 + 4*5 = 25.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 9 iff n is 11-rough (A008364).
a(k*n) >= a(n) for any n >= 0 and k > 0.
Apparently, when n > 0, a(n) = a(gcd(n, 2^3 * 3^2 * 5 * 7)).

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

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

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, 100
Offset: 0

Views

Author

Sebastian Karlsson, Nov 17 2021

Keywords

Comments

First differs from A348179 at a(101).

Examples

			a(3210) = 2020, because:
Moving 3 steps to the left from 3 gives: 3 -> 0 -> 1 -> 2.
Moving 2 steps to the left from 2 gives: 2 -> 3 -> 0.
Moving 1 step to the left from 1 gives: 1 -> 2.
Moving 0 steps to left from 0 gives: 0.
		

Crossrefs

Cf. A336668 (fixed points), A348179 (to the right).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a n = read [s !! mod (i - digitToInt (s !! i)) l | i <- [0..l-1]] :: Integer
        where s = show n; l = length s
    
  • PARI
    a(n) = { my (d=digits(n)); fromdigits(vector(#d, k, d[1+(k-1-d[k])%#d])) } \\ Rémy Sigrist, Nov 17 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)))
    

A336880 Numbers with decimal expansion d_1, ..., d_w such that for any k in 1..w there is some m in 1..w such that d_k = d_m = abs(k - m).

Original entry on oeis.org

0, 11, 110, 111, 202, 1100, 1110, 1111, 2020, 2222, 3003, 3113, 11000, 11011, 11100, 11110, 11111, 11202, 20200, 20202, 20211, 22220, 22222, 23203, 30030, 30232, 31130, 33033, 40004, 40114, 41104, 41114, 42024, 110000, 110011, 110110, 110111, 110202, 111000
Offset: 1

Views

Author

Rémy Sigrist, Aug 06 2020

Keywords

Comments

This sequence has similarities with A336668.
All repunits (A002275) belong to this sequence.
The concatenation of two terms is also a term.
The digit reversal (A004086) of a term is also a term.
For any d in 1..9, d * (1 + 10^d) is the first term containing the digit d.

Examples

			Regarding 30232:
- the first digit 3 is 3 positions away from the second digit 3 and vice versa,
- the digit 0 matches itself,
- the first digit 2 is 2 positions away from the second digit 2 and vice versa,
- so 30232 belongs to this sequence.
		

Crossrefs

Cf. A002275, A144795 (binary analog), A336668.

Programs

  • PARI
    is(n, base=10) = { my (d=digits(n, base)); for (k=1, #d, if ((k-d[k]<1 || d[k-d[k]]!=d[k]) && (k+d[k]>#d || d[k+d[k]]!=d[k]), return (0)));
    return (1) }

A349423 Index of first occurrence of n in A348179, or -1 if n never appears.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1020, 11, 1023, 31, 1024, 51, 1063, 71, 1028, 91, 20, 21012, 12, 220035, 24, 20025, 26, 20074, 28, 220095, 230, 13, 300025, 33, 10413, 53, 300026, 73, 300085, 93, 40, 1041, 42, 3000461, 14, 5041, 46, 700451, 48, 9041, 520, 15
Offset: 0

Views

Author

Sebastian Karlsson, Nov 17 2021

Keywords

Examples

			a(10) = 1020, because 1020 is the first number k such that A348179(k) = 10.
a(1111111110) = -1 (found by _Kevin Ryde_).
		

Crossrefs

Programs

  • Python
    def A348179(n):
        s, l = str(n), len(str(n))
        return int("".join(s[(i + int(s[i])) % l] for i in range(l)))
    terms = {}
    for n in range(0, 3000462): # 3000462 to get all terms of the data-section without -1s.
        if (k := A348179(n)) not in terms: terms[k] = n
    for n in range(0, 52):
        try: print(terms[n], end=", ")
        except: print(-1, end=", ") # These -1s are conjectured.
Showing 1-5 of 5 results.