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

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.

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)))
    

A354719 Replace each even digit in n with the digit to its left.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 11, 13, 11, 15, 11, 17, 11, 19, 2, 11, 22, 33, 42, 55, 62, 77, 82, 99, 33, 31, 33, 33, 33, 35, 33, 37, 33, 39, 4, 11, 24, 33, 44, 55, 64, 77, 84, 99, 55, 51, 55, 53, 55, 55, 55, 57, 55, 59, 6, 11, 26, 33, 46, 55, 66, 77
Offset: 0

Views

Author

Gavin Lupo, Jun 03 2022

Keywords

Comments

If the leftmost digit in n is even, wrap around and replace it with the rightmost digit in n (see example).

Examples

			n    =  4 2 7 8 1
        ^ ^   ^      even digits,
a(n) =  1 4 7 7 1    to their left in n
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@ Map[If[EvenQ@ #1, #2, #1] & @@ # &, Transpose@ {#, RotateRight[#, 1]}] &@ IntegerDigits[#] &, 67] (* Michael De Vlieger, Jun 19 2022 *)
  • PARI
    prec(d, k) = k--; if (! k, k = #d); k;
    a(n) = my(d=digits(n), v=d); for (k=1, #d, if (!(d[k] % 2), v[k] = d[prec(d,k)])); fromdigits(v); \\ Michel Marcus, Jun 04 2022
  • Python
    def a(n):
        digits = list(map(int, str(n)))
        out = (d if d%2 else digits[i-1] for i, d in enumerate(digits))
        return int("".join(map(str, out)))
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jun 04 2022
    
Showing 1-3 of 3 results.