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.

User: Rakesh Khanna A

Rakesh Khanna A's wiki page.

Rakesh Khanna A has authored 3 sequences.

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

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

A335075 Positions of 1's when Kolakoski sequence is grouped into four independent numbers as 1, 2, 11, 22.

Original entry on oeis.org

1, 5, 7, 13, 17, 23, 25, 29, 31, 37, 41, 43, 49, 51, 55, 59, 61, 67, 71, 73, 79, 85, 91, 95, 97, 101, 103, 109, 113, 115, 121, 125, 131, 133, 137, 141, 143, 149, 155, 157, 161, 167, 173, 175, 179, 185, 187, 191, 193, 199, 201, 205, 209, 211, 217, 221, 223, 227, 229
Offset: 1

Author

Rakesh Khanna A, May 22 2020

Keywords

Examples

			A000002 can be grouped as 1, 22, 11, 2, 1, 22, 1, 22, 11, 2, ... The positions of occurrence of 1's (1, 5, 7, ...) are given in this sequence.
		

Crossrefs

Cf. A000002.

Programs

  • Mathematica
    s = {1, 2, 2}; Do[s = Append[s, Mod[n-1, 2] + 1], {n, 3, 230}, {s[[n]]}]; Position[Split[s], {1}] // Flatten (* Amiram Eldar, Jul 24 2020 *)

A334955 Number of 1's in n-th string when A000002 is expressed as 1, 2, 2, 11, 21, 221, 22112, 11221211, 21221121121, 2212211212212112, ....

Original entry on oeis.org

0, 2, 1, 1, 2, 5, 6, 7, 12, 19, 29, 43, 62, 95, 148, 216, 322, 482, 727, 1083, 1627, 2457, 3660, 5518, 8250, 12403, 18594, 27914, 41863, 62781, 94158, 141205, 211797, 317782, 476743, 714948, 1072526, 1608732, 2413223, 5428986
Offset: 3

Author

Rakesh Khanna A, May 24 2020

Keywords

Comments

Representing A000002 as a tree. Each branch of this tree is a string. Starting from n=3, each 1 in n-th string generates either 1 or 2 in (n+1)-th string and each 2 in n-th string generates either 11 or 22 in (n+1)-st string based on the previously generated term of either 2 or 1. Hence number of terms in (n+1)-st string is sum of all terms in n-th string.

Crossrefs

Cf. A000002.

Programs

  • Python
    MAX_NUM = 10000 # Number of terms in Kolakoski Sequence
    K = [1,2,2]
    previous = 2
    # Generate Kolakoski Sequence
    for index1 in range(2,MAX_NUM):
        generator = K[index1]
        if (generator == 1 and previous == 1):
            K.append(2)
            previous = 2
        elif(generator == 2 and previous == 1):
            K.append(2)
            K.append(2)
            previous = 2
        elif(generator == 1 and previous == 2):
            K.append(1)
            previous = 1
        elif(generator == 2 and previous == 2):
            K.append(1)
            K.append(1)
            previous = 1
    branch_sum = 1
    index2 = 2
    cntr1 = 1
    while(index2 < MAX_NUM):
        ones_cntr = 0
        # This for loop extracts strings from Kolakoski Sequence
        start_index = index2
        end_index = index2 + branch_sum
        branch_sum = 0
        for index3 in range(start_index , end_index):
            branch_sum = branch_sum + K[index3]
            ones_cntr = ones_cntr + (K[index3]%2)
        index2 = end_index
        print(str(cntr1)+"   "+str(ones_cntr)+"\n")
        cntr1 = cntr1 + 1