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.

A346576 Let x run through the list of numbers with no zeros (A052382); replace each digit d of x by the digit (x mod d).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 4, 3, 2, 1, 10, 0, 12, 0, 10, 2, 16, 4, 12, 10, 20, 0, 12, 20, 0, 12, 26, 3, 10, 20, 31, 0, 10, 24, 35, 0, 14, 10, 20, 32, 42, 0, 12, 21, 32, 45, 10, 20, 30, 40, 50, 0, 14, 24, 36, 10, 20, 31, 42, 50, 64, 0, 16, 27, 10
Offset: 1

Views

Author

Rakesh Khanna A, Jul 24 2021

Keywords

Comments

Graph of the sequence generates a fractal-like image.

Examples

			If x = 247 we get 132 as 247 mod 2 = 1, 247 mod 4 = 3, and 247 mod 7 = 2. As 247 is the 205th zeroless number,  a(205) =  132.
		

Crossrefs

See A347323 for another version.

Programs

  • C
    #include 
    #define START 1
    #define END 1000
    int main(){
      unsigned int R,N,M,power_cntr;
      int mod1,mod2;
      for(N=START;N<=END;N++){
        R=N;
        M=0;
        power_cntr=1;
        while(R!=0){
          mod1=R%10;
          if(mod1==0) break;
          mod2=N%mod1;
          M+=mod2*power_cntr;
          power_cntr*=10;
          R=R/10;}
        if(mod1!=0) printf("%u %u\n",N,M);}
      return 0;}
    
  • Mathematica
    f[n_] := FromDigits @ Mod[n, IntegerDigits[n]]; f /@ Select[Range[100], !MemberQ[IntegerDigits[#], 0] &] (* Amiram Eldar, Jul 26 2021 *)
  • PARI
    a(m) = my(d=digits(m)); fromdigits(Vec(apply(x->(m % x), d)));
    apply(x->a(x), select(x->vecmin(digits(x)), [1..100])) \\ Michel Marcus, Jul 24 2021
    
  • Python
    def f(k, digits): return int("".join(map(str, map(lambda x: k%x, digits))))
    def aupton(terms):
        alst, k = [], 1
        while len(alst) < terms:
            s = str(k)
            if '0' not in s: alst.append(f(k, list(map(int, s))))
            k += 1
        return alst
    print(aupton(73)) # Michael S. Branicky, Aug 22 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

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