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

A110591 Number of digits in base-4 representation of n.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Jul 29 2005

Keywords

Comments

Number of digits in A007090(n).
In terms of the repetition convolution operator #, where (sequence A) # (sequence B) = the sequence consisting of A(n) copies of B(n), this sequence is the repetition convolution A110594 # n. Over the set of positive infinite integer sequences, # gives a nonassociative noncommutative groupoid (magma) with a left identity (A000012) but no right identity, where the left identity is also a right nullifier and idempotent. For any positive integer constant c, the sequence c*A000012 = (c,c,c,c,...) is also a right nullifier; for c = 1, this is A000012; for c = 3 this is A010701.

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a110591 0 = 1
    a110591 n = length $
       unfoldr (\x -> if x == 0 then Nothing else Just (x, x `div` 4)) n
    -- Reinhard Zumkeller, Apr 22 2011
  • Maple
    A110592 := proc(n)
        if n = 0 then
            1;
        else
            1+floor(log[4](n)) ;
        end if;
    end proc:
    seq(A110592(n),n=0..50) ; # R. J. Mathar, Sep 02 2020
  • Mathematica
    a[n_] := If[n == 0, 1, Floor[Log[4, n]] + 1];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 24 2020 *)

Formula

G.f.: 1 + (1/(1 - x))*Sum_{k>=0} x^(4^k). - Ilya Gutkovskiy, Jan 08 2017
a(n) = floor(log_4(n)) + 1 for n >= 1. - Petros Hadjicostas, Dec 12 2019

A049803 a(n) = n mod 3 + n mod 9 + ... + n mod 3^k, where 3^k <= n < 3^(k+1).

Original entry on oeis.org

0, 0, 0, 1, 2, 0, 1, 2, 0, 2, 4, 3, 5, 7, 6, 8, 10, 0, 2, 4, 3, 5, 7, 6, 8, 10, 0, 3, 6, 6, 9, 12, 12, 15, 18, 9, 12, 15, 15, 18, 21, 21, 24, 27, 18, 21, 24, 24, 27, 30, 30, 33, 36, 0, 3, 6, 6, 9, 12, 12, 15, 18, 9, 12, 15, 15, 18, 21, 21, 24, 27, 18
Offset: 1

Views

Author

Keywords

Comments

From Petros Hadjicostas, Dec 11 2019: (Start)
Conjecture: For b >= 2, consider the function s(n,b) = Sum_{1 <= b^j <= n} (n mod b^j) from p. 8 in Dearden et al. (2011). Then s(b*n + r, b) = b*s(n,b) + r*N(n,b) for 0 <= r <= b-1, where N(n,b) = floor(log_b(n)) + 1 is the number of digits in the base-b representation of n. As initial conditions, we have s(n,b) = 0 for 1 <= n <= b. (This is a generalization of a result by Robert Israel in A049802.)
Here b = 3 and a(n) = s(n,3).
We have N(n,2) = A070939(n), N(n,3) = A081604(n), N(n,4) = A110591(n), and N(n,5) = A110592(n).
If A_b(x) = Sum_{n >= 1} s(n,b)*x^n is the g.f. of the sequence (s(n,b): n >= 1) and the above conjecture is correct, then it can be proved that A_b(x) = b * A_b(x^b) * (1-x^b)/(1-x) + x * ((b-1)*x^b - b*x^(b-1) + 1)/((1-x)^2 * (1-x^b)) * Sum_{k >= 1} x^(b^k). (End)

Crossrefs

Programs

  • Maple
    a:= n-> add(irem(n, 3^j), j=1..ilog[3](n)):
    seq(a(n), n=1..105);  # Alois P. Heinz, Dec 13 2019
  • Mathematica
    Table[n * Floor@Log[3, n] - Sum[Floor[n*3^-k]*3^k, {k, Log[3, n]}], {n, 100}] (* after Federico Provvedi in A049802*) (* Metin Sariyar, Dec 12 2019 *)
  • PARI
    a(n) = sum(k=1, logint(n, 3), n % 3^k); \\ Michel Marcus, Dec 12 2019

Formula

From Petros Hadjicostas, Dec 11 2019: (Start)
Conjecture: a(3*n+r) = 3*a(n) + r*A081604(n) = 3*a(n) + r*(floor(log_3(n)) + 1) for n >= 1 and r = 0, 1, 2.
If the conjecture above is true, the g.f. A(x) satisfies A(x) = 3*(1+x+x^2)*A(x^3) + x*(2*x+1)/(1-x^3) * Sum_{k >= 1} x^(3^k). (End)

A049804 a(n) = n mod 4 + n mod 16 + ... + n mod 4^k, where 4^k <= n < 4^(k+1).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 2, 4, 6, 4, 6, 8, 10, 8, 10, 12, 14, 12, 14, 16, 18, 0, 2, 4, 6, 4, 6, 8, 10, 8, 10, 12, 14, 12, 14, 16, 18, 0, 2, 4, 6, 4, 6, 8, 10, 8, 10, 12, 14, 12, 14, 16, 18, 0, 3, 6, 9, 8, 11, 14, 17, 16, 19, 22
Offset: 1

Views

Author

Keywords

Comments

From Petros Hadjicostas, Dec 11 2019: (Start)
Conjecture: For b >= 2, consider the function s(n,b) = Sum_{1 <= b^j <= n} (n mod b^j) from p. 8 in Dearden et al. (2011). Then s(b*n + r, b) = b*s(n,b) + r*N(n,b) for 0 <= r <= b-1, where N(n,b) = floor(log_b(n)) + 1 is the number of digits in the base-b representation of n. As initial conditions, we have s(n,b) = 0 for 1 <= n <= b. (This is a generalization of a result by Robert Israel in A049802.)
Here b = 4 and a(n) = s(n,4).
We have N(n,2) = A070939(n), N(n,3) = A081604(n), N(n,4) = A110591(n), and N(n,5) = A110592(n).
If A_b(x) = Sum_{n >= 1} s(n,b)*x^n is the g.f. of the sequence (s(n,b): n >= 1) and the above conjecture is correct, then it can be proved that A_b(x) = b * A_b(x^b) * (1-x^b)/(1-x) + x * ((b-1)*x^b - b*x^(b-1) + 1)/((1-x)^2 * (1-x^b)) * Sum_{k >= 1} x^(b^k). (End)

Crossrefs

Programs

  • Maple
    a:= n-> add(irem(n, 4^j), j=1..ilog[4](n)):
    seq(a(n), n=1..105);  # Petros Hadjicostas, Dec 13 2019 (after Alois P. Heinz's program for A330358)
  • Mathematica
    Table[n * Floor@Log[4, n] - Sum[Floor[n*4^-k]*4^k, {k, Log[4, n]}], {n, 100}] (* Metin Sariyar, Dec 12 2019 *)
    a[n_] := Sum[Mod[n, 4^j], {j, 1, Length[IntegerDigits[n, 4]] - 1}];
    Array[a, 105] (* Jean-François Alcover, Dec 31 2021 *)
  • PARI
    a(n) = sum(k=1, logint(n, 4), n % 4^k); \\ Michel Marcus, Dec 12 2019

Formula

From Petros Hadjicostas, Dec 11 2019: (Start)
Conjecture: a(4*n+r) = 4*a(n) + r*A110591(n) = 4*a(n) + r*(floor(log_4(n)) + 1) for n >= 1 and r = 0, 1, 2, 3.
If the conjecture above is true, the g.f. A(x) satisfies A(x) = 4*(1 + x + x^2 + x^3)*A(x^4) + x*(1 + 2*x + 3*x^2)/(1 - x^4) * Sum_{k >= 1} x^(4^k). (End)

A330358 a(n) = n mod 5 + n mod 25 + ... + n mod 5^k, where 5^k <= n < 5^(k+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 2, 4, 6, 8, 5, 7, 9, 11, 13, 10, 12, 14, 16, 18, 15, 17, 19, 21, 23, 20, 22, 24, 26, 28, 0, 2, 4, 6, 8, 5, 7, 9, 11, 13, 10, 12, 14, 16, 18, 15, 17, 19, 21, 23, 20, 22, 24, 26, 28, 0, 2, 4, 6, 8, 5, 7, 9, 11, 13, 10
Offset: 1

Views

Author

Petros Hadjicostas, Dec 12 2019

Keywords

Comments

Conjecture: For b >= 2, consider the function s(n,b) = Sum_{1 <= b^j <= n} (n mod b^j) from p. 8 in Dearden et al. (2011). Then s(b*n + r, b) = b*s(n,b) + r*N(n,b) for 0 <= r <= b-1, where N(n,b) = floor(log_b(n)) + 1 is the number of digits in the base-b representation of n. As initial conditions, we have s(n,b) = 0 for 1 <= n <= b. (This is a generalization of a result by Robert Israel in A049802.)
Here b = 5 and a(n) = s(n,5).
We have N(n,2) = A070939(n), N(n,3) = A081604(n), N(n,4) = A110591(n), and N(n,5) = A110592(n).
If A_b(x) = Sum_{n >= 1} s(n,b)*x^n is the g.f. of the sequence (s(n,b): n >= 1) and the above conjecture is correct, then it can be proved that A_b(x) = b * A_b(x^b) * (1-x^b)/(1-x) + x * ((b-1)*x^b - b*x^(b-1) + 1)/((1-x)^2 * (1-x^b)) * Sum_{k >= 1} x^(b^k).

Crossrefs

Programs

  • Maple
    a:= n-> add(irem(n, 5^j), j=1..ilog[5](n)):
    seq(a(n), n=1..105);  # Alois P. Heinz, Dec 13 2019
  • Mathematica
    a[n_] := Sum[Mod[n, 5^j], {j, 1, Length[IntegerDigits[n, 5]] - 1}];
    Array[a, 105] (* Jean-François Alcover, Dec 31 2021 *)
  • PARI
    a(n) = sum(k=1, logint(n, 5), n % 5^k);
    for(n=1, 100, print1(a(n), ", ")); \\ (after Michel Marcus's program in A049804)

Formula

Conjecture: a(5*n+r) = 5*a(n) + r*A110592(n) = 5*a(n) + r*(floor(log_5(n)) + 1) for n >= 1 and r = 0, 1, 2, 3, 4.
If the conjecture above is true, the g.f. A(x) satisfies A(x) = 5*(1 + x + x^2 + x^3 + x^4)*A(x^5) + x*(1 + 2*x + 3*x^2 + 4*x^3)/(1 - x^5) * Sum_{k >= 1} x^(5^k).

A110595 a(1)=5. For n > 1, a(n) = 4*5^(n-1) = A005054(n).

Original entry on oeis.org

5, 20, 100, 500, 2500, 12500, 62500, 312500, 1562500, 7812500, 39062500, 195312500, 976562500, 4882812500, 24414062500, 122070312500, 610351562500, 3051757812500, 15258789062500, 76293945312500, 381469726562500
Offset: 1

Views

Author

Jonathan Vos Post, Jul 29 2005

Keywords

Comments

a(n) is the number of n-digit integers that contain only even digits (A014263). - Bernard Schott, Nov 11 2022

Crossrefs

Programs

  • Mathematica
    Join[{5},NestList[5#&,20,20]] (* Harvey P. Dale, Jun 19 2013 *)
    Rest[CoefficientList[Series[5 x (1 - x)/(1 - 5 x), {x,0,50}], x]] (* G. C. Greubel, Sep 01 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec(5*x*(1-x)/(1-5*x)) \\ G. C. Greubel, Sep 01 2017

Formula

O.g.f.: 5*x*(1-x)/(1-5*x). - Better definition from R. J. Mathar, May 13 2008
Sum_{n>=1} 1/a(n) = 21/80. - Bernard Schott, Nov 11 2022

Extensions

Better definition from R. J. Mathar, May 13 2008
Incorrect comment removed by Michel Marcus, Nov 11 2022

A357143 a(n) is sum of the base-5 digits of n each raised to the number of digits of n in base 5.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 5, 10, 17, 4, 5, 8, 13, 20, 9, 10, 13, 18, 25, 16, 17, 20, 25, 32, 1, 2, 9, 28, 65, 2, 3, 10, 29, 66, 9, 10, 17, 36, 73, 28, 29, 36, 55, 92, 65, 66, 73, 92, 129, 8, 9, 16, 35, 72, 9, 10, 17, 36, 73, 16, 17, 24, 43, 80, 35, 36, 43, 62, 99, 72, 73, 80, 99, 136, 27
Offset: 1

Views

Author

Keywords

Examples

			For n = 13_10 = 23_5 (2 digits in base 5): a(13) = 2^2 + 3^2 = 13.
For n = 73_10 = 243_5 (3 digits in base 5): a(73) = 2^3 + 4^3 + 3^3 = 99.
		

Crossrefs

Cf. in base 10: A157714, A101337, A151544.

Programs

  • Maple
    f:= proc(n) local L,d,i;
      L:= convert(n,base,5);
      d:= nops(L);
      add(L[i]^d,i=1..d)
    end proc:
    map(f,[$1..100]); # Robert Israel, Oct 26 2023
  • Mathematica
    a[n_] := Total[IntegerDigits[n, 5]^IntegerLength[n, 5]]; Array[a, 100] (* Amiram Eldar, Oct 30 2022 *)
  • PARI
    a(n) = my(d=digits(n, 5)); sum(k=1, #d, d[k]^#d); \\ Michel Marcus, Oct 29 2022
    
  • Python
    from sympy.ntheory.factor_ import digits
    def A357143(n):
        t = len(s:=digits(n,5)[1:])
        return sum(d**t for d in s) # Chai Wah Wu, Oct 31 2022

Formula

a(n) = Sum_{i=1..A110592(n)} d(i)^A110592(n), where d(i) is the i-th digit of n in base 5.

Extensions

Corrected and extended by Michel Marcus, Oct 29 2022

A037864 a(n)=(number of digits <=2)-(number of digits >2) in base 5 representation of n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A110592.

Programs

A217115 Greatest number (in decimal representation) with n nonprime substrings in base-5 representation (substrings with leading zeros are considered to be nonprime).

Original entry on oeis.org

67, 88, 442, 567, 2213, 2837, 3067, 11068, 14713, 15337, 15338, 57943, 73568, 77213, 76697, 289717, 280338, 370443, 386068, 386587, 389713, 1852217, 1524067, 1898442, 1930342, 1932943, 1948568, 7242943, 9261088, 9664717, 9586567, 9654712, 9710942, 9742849, 46305443
Offset: 0

Views

Author

Hieronymus Fischer, Dec 20 2012

Keywords

Comments

The sequence is well-defined in that for each n the set of numbers with n nonprime substrings is not empty and finite. Proof of existence: Define m(n):=2*sum_{j=i..k} 5^j, where k:=floor((sqrt(8n+1)-1)/2), i:= n-(k(k+1)/2). For n=0,1,2,3,... the m(n) in base-5 representation are 2, 22, 20, 222, 220, 200, 2222, 2220, 2200, 2000, 22222, 22220, .... m(n) has k+1 digits and (k-i+1) 2’s. Thus, the number of nonprime substrings of m(n) is ((k+1)(k+2)/2)-k-1+i=(k(k+1)/2)+i=n. This proves the statement of existence. Proof of finiteness: Each 4-digit base-5 number has at least 2 nonprime substrings. Hence, each m := 4*floor((n+2)/2)-digit number has at least 2*(m/4) = 2*floor((n+2)/2) >= n+1 nonprime substrings. Consequently, there is a boundary b < 5^(m-1) such that all numbers > b have more than n nonprime substrings. It follows, that the set of numbers with n nonprime substrings is finite.

Examples

			a(0) = 67, since 67 = 232_5 (base-5) is the greatest number with zero nonprime substrings in base-5 representation.
a(1) = 88 = 323_5 has 6 substrings in base-5 representation (2, 2, 3, 23, 32, 323), the only nonprime substring is 323_5. 88 is the greatest number with 1 nonprime substring.
a(2) = 442 = 3232_5 has 10 substrings in base-5 representation (2, 2, 3, 3, 23, 32, 32, 232, 323 and 3232), exactly 2 of them are nonprime substrings (323_5=88 and 3232_5=442), and there is no greater number with 2 nonprime substrings in base-5 representation.
a(5) = 2837 = 42322_5 has 5 nonprime substrings in base-5 representation, these are 4, 22, 42, 322 and 4232, all the other substrings are prime. There is no greater number with 5 nonprime substrings in base-5 representation.
		

Crossrefs

Formula

a(n) >= A217105(n).
a(n) >= A217305(A000217(A110592(a(n)))-n).
a(n) <= 5^(n+3).
a(n) <= 5^(4*floor(n/2)), n>1.
a(n) <= 5^min((n + 6)/2, 9*floor((n+20)/21)).
a(n) <= 125*5^(n/2).
With m := floor(log_5(a(n))) + 1:
a(n+m+1) >= 5*a(n), if a(n)!=1 (mod 5).
a(n+m) >= 5*a(n), if a(n)=1 (mod 5).

A357954 Integers k that are periodic points for some iterations of k->A357143(k).

Original entry on oeis.org

1, 2, 3, 4, 13, 18, 28, 118, 194, 289, 338, 353, 354, 419, 489, 528, 609, 769, 1269, 1299, 2081, 4890, 4891, 9113, 18575, 18702, 20759, 35084, 1874374, 338749352, 2415951874
Offset: 1

Views

Author

Keywords

Comments

Given the function A357143(k), a number k is a term of the sequence if there exists a j such that A357143^j(k) = k, where j is the number of iterations applied.
The sequence is finite.
Proof: A357143(k) < k for all big enough k. g(k) = A110592(k)*4^A110592(k) is clearly an upper bound of A357143(k). Hence k > g(k) -> k > A357143(k), therefore every periodic point must be in an interval [s;t] such that for every k in [s;t] k <= g(k). Limit_{k->oo} g(k)/k = 0; now using the little-o definition we can show that there always exists a certain k_0 such that, for every k > k_0, k > g(k). The conclusion is that there must exist a finite number of intervals [s;t] and, consequently, a finite number of periodic points.
Every term k of the sequence is a periodic point (either a perfect digital invariant or a sociable digital invariant) for the function A357143(k).
The longest cycle needs 6 iterations to end: [489, 609, 769, 1269, 1299, 2081].

Examples

			k=9113 is a fixed point (perfect digital invariant) for the reiterated function A357143(k):
    9113_10 = 242423_5 (a 6-digit number in base 5);
    A357143(9113) = 2^6 + 4^6 + 2^6 + 4^6 + 2^6 + 3^6 = 9113.
k=18702 is a sociable digital invariant for the reiterated function A357143(k), requiring 2 iterations:
  1st iteration:
    18702_10 = 1044302_5 (a 7-digit number in base 5);
    A357143(18702) = 1^7 + 0^7 + 4^7 + 4^7 + 3^7 + 0^7 + 2^7 = 35084;
  2nd iteration:
    35084_10 = 2110314_5 (also a 7-digit number in base 5);
    A357143(35084) = 2^7 + 1^7 + 1^7 + 0^7 + 3^7 + 1^7 + 4^7 = 18702.
		

Crossrefs

Cf. A357143 , A010346 (fixed points), A110592 (exponents p(k)).
Cf. A157714 (base-10 sociable digital invariants), A101337 (A357143(k) base 10), A151544 (base-10 periodic points).
Showing 1-9 of 9 results.