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.

A276328 Digit sum when n is expressed in greedy A001563-base (A276326).

Original entry on oeis.org

0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10, 8, 9, 5, 6, 7, 8, 6, 7, 1
Offset: 0

Views

Author

Antti Karttunen, Aug 30 2016

Keywords

Comments

a(n) is the number of terms of A001563 needed to sum to n using the greedy algorithm.
This seems to give also the minimal number of terms of A001563 that sum to n (checked empirically up to n=3265920), but it would be nice to know for sure whether this holds for all n.

Examples

			For n=1, the largest term of A001563 <= 1 is A001563(1) = 1, thus a(1) = 1.
For n=2, the largest term of A001563 <= 2 is A001563(1) = 1, thus a(2) = 1 + a(2-1) = 2.
For n=18, the largest term of A001563 <= 18 is A001563(3) = 18, thus a(18) = 1.
For n=20, the largest term of A001563 <= 20 is A001563(3) = 18, thus a(20) = 1 + a(20-18) = 3.
For n=36, the largest term of A001563 <= 36 is A001563(3) = 18, thus a(36) = 1 + a(18) = 2.
		

Crossrefs

Cf. A276091 (gives all n for which a(n) = A276337(n)).
Cf. also A007895, A034968, A265744, A265745 for similar sequences.

Programs

  • Mathematica
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]]; {0}~Join~Table[Total@ f@ n, {n, 120}] (* Michael De Vlieger, Aug 31 2016 *)

Formula

a(0) = 0; for n >= 1, a(n) = 1 + a(n-A258199(n)).
a(0) = 0; for n >= 1, a(n) = A276333(n) + a(A276335(n)).
Other identities and observations. For all n >= 0:
a(A276091(n)) = A000120(n).
a(n) >= A276337(n).
It also seems that a(n) <= A276332(n) for all n.

A276334 a(n) = A258199(n) * A276333(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 4, 4, 4, 8, 8, 8, 8, 12, 12, 12, 12, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 72, 72, 72, 72, 72, 72, 72, 72
Offset: 0

Views

Author

Antti Karttunen, Aug 30 2016

Keywords

Comments

a(n) is obtained by first replacing with zeros all other digits except the leftmost (the most significant) in the greedy A001563-base representation of n (A276326), then converting back to decimal. Used to compute A276335.

Crossrefs

Programs

Formula

a(n) = A258199(n) * A276333(n).
A276335(n) = n - a(n).

A276331 a(0) = 0 and for n >= 1, a(n) = n minus the largest term of A001563 that divides n.

Original entry on oeis.org

0, 0, 1, 2, 0, 4, 5, 6, 4, 8, 9, 10, 8, 12, 13, 14, 12, 16, 0, 18, 16, 20, 21, 22, 20, 24, 25, 26, 24, 28, 29, 30, 28, 32, 33, 34, 18, 36, 37, 38, 36, 40, 41, 42, 40, 44, 45, 46, 44, 48, 49, 50, 48, 52, 36, 54, 52, 56, 57, 58, 56, 60, 61, 62, 60, 64, 65, 66, 64, 68, 69, 70, 54, 72, 73, 74, 72, 76, 77, 78, 76, 80, 81, 82, 80
Offset: 0

Views

Author

Antti Karttunen, Aug 30 2016

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@ NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]]; {0}~Join~Table[n - # #! &[Length@ TakeWhile[Reverse@ f@ n, # == 0 &] + 1], {n, 84}] (* Michael De Vlieger, Aug 31 2016 *)
  • Scheme
    (define (A276331 n) (- n (A276330 n)))

Formula

a(n) = n - A276330(n).
Showing 1-3 of 3 results.