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

A276134 a(5n) = a(n), a(5n+1) = a(5n+2) = a(5n+3) = a(5n+4) = a(n) + 1, a(0) = 0.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 21 2016

Keywords

Comments

Number of nonzero digits in the base 5 representation of n.
Fixed point of the mapping 0 -> 01111, 1 -> 12222, 2 -> 23333, ...
Self-similar or fractal sequence (underlining every fifth term, reproduce the original sequence).

Examples

			The evolution starting with 0 is: 0 -> 01111 -> 0111112222122221222212222 -> ...
...
a(0) = 0;
a(1) = a(5*0+1) = a(0) + 1 = 1;
a(2) = a(5*0+2) = a(0) + 1 = 1;
a(3) = a(5*0+3) = a(0) + 1 = 1;
a(4) = a(5*0+4) = a(0) + 1 = 1;
a(5) = a(5*1+0) = a(1) = 1;
a(6) = a(5*1+1) = a(1) + 1 = 2, etc.
...
Also a(10) = 1, because 10 (base 10) = 20 (base 5) and 20 has 1 nonzero digit.
		

Crossrefs

Programs

  • Maple
    f:= n -> nops(subs(0=NULL,convert(n,base,5))):
    map(f, [$0..100]); # Robert Israel, Sep 07 2016
  • Mathematica
    Join[{0}, Table[IntegerLength[n, 5] - DigitCount[n, 5, 0], {n, 120}]]

Formula

a(5^k) = 1.
a(5^k-1) = k.
a(5^k-m) = k, k>0, m = 2,3,4.
a(5^k+m) = 2, k>0, m = 1,2,3,4.
a(5^k-a(5^k)) = k.
a(5^k+(-1)^k) = (k + (-1)^k*(k - 1) + 3)/2.
a(5^k+(-1)^k-1) = A093178(k).
a(5^k+(-1)^k+1) = A000034(k+1), k>0.
G.f. g(x) satisfies g(x) = (1+x+x^2+x^3+x^4)*g(x^5) + (x+x^2+x^3+x^4)/(1-x^5). - Robert Israel, Sep 07 2016

A336797 Numbers, not divisible by 3, whose squares have exactly 4 nonzero digits in base 3.

Original entry on oeis.org

7, 14, 16, 17, 26, 35, 47, 68, 350, 3788
Offset: 1

Views

Author

Michel Marcus, Jan 27 2021

Keywords

Comments

Is this sequence infinite?
Next term, if it exists, is > 3^500. - James Rayman, Feb 05 2021

Examples

			7^2=49 in base 3 is 1211, so 7 is a term.
14^2=196 in base 3 is 21021, so 14 is a term.
		

Crossrefs

Cf. A007089 (numbers in base 3), A160385.

Programs

  • Mathematica
    Select[Range[4000], Mod[#, 3] > 0 && Length @ Select[IntegerDigits[#^2, 3], #1 > 0 &] == 4 &] (* Amiram Eldar, Jan 27 2021 *)
  • PARI
    isok(n) = (n%3) && #select(x->x, digits(n^2, 3)) == 4;
    
  • Python
    from gmpy2 import isqrt, is_square
    import itertools
    N = 1000
    powers = [1]
    a_list = []
    while len(powers) < N: powers.append(3 * powers[-1])
    def attempt(n):
        if is_square(n): a_list.append(int(isqrt(n)))
    for A, B, C in itertools.combinations(powers[1:], 3):
        for a, b, c in itertools.product([1, 2], repeat=3):
                attempt(a*A + b*B + c*C + 1)
    print(sorted(a_list)) # James Rayman, Feb 05 2021
Showing 1-2 of 2 results.