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

A378359 a(1) = 0, a(n) = Sum_{digits d in a(n-1)} c(d,n-1), where c(d,k) is the number of digits d in a(1..k).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 13, 14, 15, 16, 17, 18, 19, 20, 5, 3, 3, 4, 3, 5, 4, 4, 5, 5, 6, 3, 6, 4, 6, 5, 7, 3, 7, 4, 7, 5, 8, 3, 8, 4, 8, 5, 9, 3, 9, 4, 9, 5, 10, 23, 13, 31, 33, 14, 32, 19, 29, 12, 30, 21, 32, 25, 20, 16, 32
Offset: 1

Views

Author

Keywords

Comments

We begin with the empty sum 0.
This sequence also counts zeros in the decimal expansion of a number.

Examples

			Let c(d) represent c(d,n-1) for concision below:
a(2) = 1 since a(1) = 0; c(0) = 1.
a(3) = 1 since a(2) = 1; c(1) = 1.
a(4) = 2 since a(3) = 1; c(1) = 2.
...
a(20) = 10 since a(19) = 1, c(1) = 10.
a(21) = 13 since a(20) = 10, c(0)+c(1) = 2+11 = 13.
...
a(28) = 20 since a(27) = 19, c(1)+c(9) = 18+2 = 20.
a(29) = 5 since a(28) = 20, c(0)+c(2) = 3+2 = 5.
..
a(68) = 14 since a(67) = 33, c(3) = 14 (note: not 2*c(3) = 28), etc.
		

Crossrefs

Cf. A279818.

Programs

  • Mathematica
    nn = 10^4; a[1] = j = 0; c[_] := 0;
    Do[k = Total@ Map[c[#1] += #2 & @@ # &, Tally@ IntegerDigits[j] ];
      Set[{a[n], j}, {k, k}], {n, 2, nn}]; Array[a, nn]
  • PARI
    notdoin(d,n) = if(!d && !n, 1, #select(x->x==d,digits(n))); \\ "notdoin" = number of times digit occurs in n
    A378359list(up_to_n) = { my(v=vector(up_to_n)); v[1] = 0; for(n=2, up_to_n, my(digs = if(2==n,[0],vecsort(digits(v[n-1]),,8))); v[n] = sum(i=1,#digs,sum(j=1,n-1,notdoin(digs[i],v[j])))); (v); }; \\ Antti Karttunen, Nov 25 2024
    
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an, c = 0, Counter()
        while True:
            yield an
            s = str(an)
            c.update(s)
            an = sum(c[d] for d in set(s))
    print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 25 2024

A378360 a(1) = 0, a(n) = Sum_{digits d in a(n-1)} (d+[d==0])*c(d,n-1) where c(d,k) = number of digits d in a(1..a(k)), with Iverson bracket.

Original entry on oeis.org

0, 1, 1, 2, 2, 4, 4, 8, 8, 16, 9, 9, 18, 28, 38, 43, 18, 53, 14, 22, 10, 9, 27, 19, 44, 24, 42, 48, 92, 63, 24, 60, 21, 31, 25, 34, 62, 50, 19, 65, 50, 30, 27, 42, 78, 85, 102, 51, 48, 132, 72, 64, 92, 101, 24, 100, 27, 77, 49, 136, 87, 144, 91, 101, 33, 33, 39
Offset: 1

Views

Author

Keywords

Comments

This sequence is a version of the "paint sprayer" sequence A279818 that engages all decimal digits, including d = 0. For each digit d in a(n-1), a(n) records the sum of all same digits d observed in terms a(i); i = 1..n-1, summed over every d in a(n-1), wherein each occurrence of digit d = 0 in a(n-1) and prior terms is counted as 1 instead of 0.
The sums form 2^10 or 1024 trajectories similar to those in A279818, which exhibits 2^9 trajectories, since digit 0 has no effect on the sums in that sequence.
Let signature S be the set of digits in the number m; for reference we may order the digits least to greatest. For example, for m = 90210, S(90210) = {0, 1, 2, 9}. Signature S may be compactified via the sum of 2^k for k in S. Thus, for example, S(90210) compactified is 2^0 + 2^1 + 2^2 + 2^9 = 1+2+4+512 = 521.
Let trajectory T(S) be that associated with S. In scatterplot, the trajectories are arranged such that the smaller compactified signatures have the least "slope" while the pandigital signature 1023 has the greatest slope.
This trajectory arrangement is present and clearer in A279818, but those signatures involving 0 (odd compactified signatures) in this sequence are skewed, since 0 cannot begin a decimal number m > 0, and thereby has a smaller frequency.
Compared to A279818, the scatterplot appears to have denser trajectories.
The number 5 cannot appear in the sequence for n > 18.
First pandigital number is a(28035151) = 1053287964.
The signature S = {5} has not appeared for n < 10^8. It will first appear for some repdigit where the repeated digit is d = 5.

Examples

			Let c(d) be the number of digits d in the sequence a(1..n-1), abbreviating the dyadic function for concision:
a(2) = 1 since 0+[0==0]*c(0) = 1*1 = 1.
a(3) = 1 since 1+[1==0]*c(1) = 1*1 = 1.
a(4) = 2 since 1*c(1) = 1*2 = 2.
a(5) = 2 since 2*c(2) = 2*1 = 2.
a(6) = 4 since 2*c(2) = 2*2 = 4.
...
a(10) = 16 since a(9) = 8, and 8*c(8) = 8*2 = 16.
a(11) = 9 since 1*c(1)+6*c(6) = 1*3+6*1 = 9.
...
a(19) = 14 since a(18) = 53, and 5*c(5)+3*c(3) = 5*1+3*3 = 14.
a(20) = 22 since 1*c(1)+4*c(4) = 1*6+4*4 = 22.
a(21) = 10 since 2*c(2) = 2*5 = 10, (not 2*c(2)+2*c(2) = 20), etc.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; a[1] = j = 0; c[_] := 0;
    Do[k = Total@ Map[(#1 + Boole[#1 == 0])*(c[#1] += #2) & @@ # &,
        Tally@ IntegerDigits[j] ];
      Set[{a[n], j}, {k, k}],
    {n, 2, nn}]; Array[a, nn]

A330807 a(1) = 2; a(n+1) = Sum_{k=1..n} {S(a(k)): S(a(k)) = S(a(n))}, where S is sopfr (A001414).

Original entry on oeis.org

2, 2, 4, 4, 8, 6, 5, 10, 7, 14, 9, 12, 21, 10, 28, 11, 22, 13, 26, 15, 8, 18, 16, 24, 18, 32, 20, 27, 36, 30, 40, 33, 14, 45, 44, 30, 50, 12, 35, 24, 54, 55, 16, 40, 66, 32, 60, 36, 70, 28, 77, 18, 48, 88, 17, 34, 19, 38, 21, 80, 39, 48, 99, 51, 20, 63, 52, 68, 42, 48, 110, 36, 90, 65, 54, 121, 22, 78, 72, 60, 72, 84, 42, 96
Offset: 1

Views

Author

David James Sycamore, Jan 01 2020

Keywords

Comments

a(n+1) is k(n)*sopfr(a(n)), where k(n) is the number of times (up to and including a(n)) that a term having the same sopfr as a(n) has occurred in the sequence so far.
The smallest possible initial term is a(1)=2, since 2 is the smallest number having a prime divisor. Not every integer appears; for example, 3 cannot occur unless chosen as a(1) (in which case 2 cannot appear).
The primes do not appear in their natural order (e.g., 31 precedes 29). If the lesser of twin primes p is a(k) and the greater twin has not already occurred, then a(k+2) is the greater twin. Whereas if a composite number appears, it may appear more than once, a prime > 2, if it appears, can appear once only. Open question: Do all primes (except for 3) eventually appear?

Examples

			a(2)=2 because it is the sopfr of a(1) and there are no prior terms which could contribute to the sum.
a(3)=2+2=4 because 2 has occurred twice already as sopf of prior terms.
a(7)=5 because a(6)=6 and has sopfr 5 which has not been seen before.
		

Crossrefs

Programs

  • Magma
    sopfr:=func; a:=[2]; for n in [2..90] do  Append(~a,&+[sopfr(a[k]):k in [1..n-1]|sopfr(a[k]) eq  sopfr(a[n-1])]); end for; a; // Marius A. Burtea, Jan 01 2020
  • Mathematica
    s[1] = 0; s[n_] := Plus @@ Times @@@ FactorInteger[n]; a[1] = 2; a[n_] := a[n] = (s1 = s[a[n - 1]])*(1 + Sum[Boole[s[a[k]] == s1], {k, 1, n - 2}]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)

A330814 a(1) = 1; a(n+1) = Sum_{k=1..n} {q(a(k)): q(a(k)) = q(a(n))}, where q(n) = A007953(n) + A055642(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 14, 21, 10, 9, 20, 8, 18, 11, 12, 15, 16, 27, 22, 12, 20, 16, 36, 33, 24, 32, 28, 12, 25, 45, 44, 30, 30, 35, 40, 18, 55, 24, 40, 24, 48, 14, 35, 50, 42, 56, 13, 30, 40, 36, 66, 28, 36, 77, 16, 54
Offset: 1

Views

Author

David James Sycamore, Jan 01 2020

Keywords

Comments

a(n+1) = k(n)*q(a(n)), where k(n) is the number of times (up to and including a(n)) that a term having the same q-value as a(n) has occurred in the sequence so far.

Examples

			a(2) is q(a(1))=a(1)=2; a(10)=q(10)=3, and 3=q(a(2)) has been seen once before, so a(11)=3+3=6.
		

Crossrefs

Programs

  • Magma
    q:=func; a:=[1,2]; for n in [3..70] do Append( ~a,&+[ q(a[k-1]):k in [2..n]| q(a[k-1]) eq q(a[n-1])]); end for; a; // Marius A. Burtea, Jan 02 2020
  • Mathematica
    s[n_] := Plus @@(d = IntegerDigits[n]) + Length[d]; a[1] = 1; a[n_] := a[n] = (s1 = s[a[n - 1]])*(1 + Sum[Boole[s[a[k]] == s1], {k, 1, n - 2}]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)

A378316 a(1) = 1, a(2) = 2. For n > 2, a(n) is the sum of the digits of a(n-2) plus the sum of the same digits occurring in all terms a(i); 1 <= i <= n-2.

Original entry on oeis.org

1, 2, 1, 2, 2, 4, 6, 4, 6, 8, 12, 8, 11, 16, 5, 24, 5, 22, 10, 14, 7, 24, 7, 36, 14, 27, 33, 39, 9, 21, 18, 30, 35, 15, 33, 32, 24, 49, 52, 59, 51, 66, 48, 36, 68, 72, 88, 56, 56, 94, 105, 85, 64, 119, 110, 70, 18, 35, 91, 93, 83, 108, 119, 109, 104, 114, 73, 79
Offset: 1

Views

Author

David James Sycamore, Nov 23 2024

Keywords

Comments

Definition related to that of the paint sprayer sequence A279818 so we may see similar behaviors and plots for this sequence.
From Michael De Vlieger, Dec 08 2024: (Start)
Let c(d) be the cardinality of digits d in a(k), k = 1..n-m. Then a(n) is the sum of d*c(d) across the set of (distinct) digits in a(n-m), m = 2. Then it is easy to see that zeros have no effect on the sums.
Scatterplot shows "rays" associated with distinct digits in a(n-2), therefore there are 2^(b-1) rays. Since b = 10, there are 512 rays in the plot, just as there are in A279818.
A279818 is the case regarding m = 1.
A378360(n) is the sum of (d+[d=0])*c(d) across the set of digits in a(n-m), m = 1, starting instead with a(1) = 0, so as to count zeros, and thus the scatterplot shows 1024 rays. (End)

Examples

			From _Michael De Vlieger_, Dec 08 2024: (Start)
Let c(d) be the number of digits d in a(k), k = 1..n-2.
a(3) = 1 since a(1) = 1.
a(4) = 2 since a(2) = 2.
a(5) = 2 since a(1) = a(3) = 1, i.e., 1*c(1) = 1*2 = 2.
a(6) = 4 since a(2) = a(4) = 2, i.e., 2*c(2) = 2*2 = 4.
a(7) = 6 since a(2) = a(4) = a(5) = 2, i.e., 2*c(2) = 2*3 = 6.
a(13) = 11 since a(11) = 12, and 1*c(1) + 2*c(2) = 1*3 + 2*4 = 3+8 = 11.
a(15) = 5 since a(13) = 11, and 1*c(1) = 1*5 = 5; note, there is 1 distinct digit d = 1, but two 1's in a(13), etc. (End)
		

Crossrefs

Programs

  • Mathematica
    nn = 120; a[1] = i = 1; a[2] = j = 2; c[_] := 0;
    Do[(k = Total@ Map[#1*(c[#1] += #2) & @@ # &, #]) &@
      Tally@ IntegerDigits[i];
      Set[{a[n], i, j}, {k, j, k}], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Dec 08 2024 *)

A342616 a(1) = 1, a(n+1) = Sum_{d | a(n)} c_d, where c_d = number of instances of d | a(k) for 1 <= k < n.

Original entry on oeis.org

1, 1, 2, 4, 7, 6, 11, 8, 15, 13, 11, 13, 14, 21, 21, 25, 19, 18, 33, 29, 21, 36, 49, 30, 52, 43, 27, 41, 29, 31, 31, 33, 49, 42, 76, 55, 46, 51, 53, 40, 70, 78, 85, 53, 46, 65, 60, 116, 79, 50, 87, 72, 123, 74, 77, 72, 140, 132, 143, 74, 89, 62, 92, 110, 125, 82
Offset: 1

Views

Author

Michael De Vlieger, Mar 17 2021

Keywords

Comments

For all n, we have c_1 = (n-1) since 1 | n for all nonzero n.
There are 2 means by which we set c_p = 1 for p prime. Let m = a(n), the progenitor of a(n+1). The first is directly via Sum_{d | a(n)} c_d = p. The second is indirectly, through Sum_{d | a(n)} c_d = m, and novel p | m. An example of the first is the appearance of a(3) = 2, and the second, a(6) = 6 is divisible by 3, a prime not yet appearing in the sequence.
For a(n) = p novel, a(n+1) = n, since we have (n-1) instances of d = 1 and 1 instance of p. Subsequent appearances of p have a(n+1) exceed n. Primes may appear more than once.
The two instances of 1 that begin the sequence yield a(3) = 2. The terms a(2) and a(3) are the only instances of a(n) < n. This is because only register c_1 > 0 for those terms, and in all other terms, we have the progenitor term a(n) > 1. Indeed, 1 can never again arise, because the only way we have Sum_{d | a(n)} c_d = 1 is when novel a(n) = 1 where d = 1 has only appeared once before. Clearly 1 has already appeared twice for n >= 2. No other number has 1 divisor, therefore there are only 2 occasions of 1 in the sequence, i.e., a(1) = a(2) = 1.
Generally for n > 3, m < n does not appear as a term. This implies the lower bound a(n) = n for n > 3. We have shown that a(n) = n results from certain prime progenitors m.
The striations seen in the scatterplot relate to the lesser prime divisors of progenitors a(n) = m -> a(n+1).

Examples

			a(2) = 1 since we have 1 instance of 1 | a(k) for 1 <= k < n (which we shall abbreviate hereinafter as a count 1(1)).
a(3) = 2 since we have 2(1).
a(4) = 4 since we have 3(1) and 1(2).
a(5) = 7 since we have 4(1), 2(2), and 1(4).
a(6) = 6 since we have 5(1) and 1(7).
a(7) = 11 since we have 6(1), 3(2), 1(3), and 1(6); 6+3+1+1 = 11.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {1}, c}, Do[(Map[If[! IntegerQ[c[#] ], Set[c[#], 1], c[#]++] &, #]; AppendTo[a, Total[Map[c[#] &, #]] ]) &@ Divisors[a[[-1]] ], 65]; a] (* Michael De Vlieger, Mar 17 2021 *)

A352610 a(0) = 0; a(n+1) = Sum_{d a distinct decimal digit in a(n)} binomial(c(d)-1,2), where c(d) is the number of occurrences of d in a(j), 0 <= j <= n; see comments.

Original entry on oeis.org

0, 0, 1, 0, 3, 0, 6, 0, 10, 16, 4, 0, 21, 6, 3, 1, 10, 43, 4, 3, 6, 6, 10, 57, 0, 45, 7, 1, 28, 1, 36, 25, 6, 21, 51, 61, 94, 10, 133, 112, 130, 230, 129, 175, 184, 206, 155, 231, 312, 353, 106, 426, 131, 416, 445, 81, 381, 517, 486, 143, 651, 642, 249, 172, 629
Offset: 0

Views

Author

David James Sycamore, Mar 16 2022

Keywords

Comments

In other words, a(n+1) is the sum, taken over each distinct d in a(n), of the number of pairs (d,d) counted from different occurrences of d in a(j), 0 <= j <= n.
Every term is the sum of one or more triangular numbers (A000217). If no digit in a(n) has occurred before, a(n+1) = 0 (there are 7 such terms). Some numbers (0,1,3,4,6,10,...) occur multiple times, while others (2,5,8,11,...) never occur.
a(28844) = 2417583609 is the first pandigital term. Similar to A279818.

Examples

			a(1) = 0 because there are no terms prior to a(0)=0;
a(2) = 1 because 0 has occurred just twice, and 0,0 can be counted just once.
To calculate a(39) given that a(38) = 133: c(1) = 14 so (1,1) can be counted 13*14/2=91 times, c(3) = 7 so (3,3) can be counted 6*7/2 = 21 times. Therefore a(39) = 91 + 21 = 112.
		

Crossrefs

Programs

Showing 1-7 of 7 results.