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.

A263941 Minimal most likely sum for a roll of n 8-sided dice.

Original entry on oeis.org

1, 9, 13, 18, 22, 27, 31, 36, 40, 45, 49, 54, 58, 63, 67, 72, 76, 81, 85, 90, 94, 99, 103, 108, 112, 117, 121, 126, 130, 135, 139, 144, 148, 153, 157, 162, 166, 171, 175, 180, 184, 189, 193, 198, 202, 207, 211, 216, 220, 225
Offset: 1

Views

Author

Gianmarco Giordano, Oct 30 2015

Keywords

Examples

			For n=1, there are eight equally likely outcomes, 1,2,3,4,5,6,7,8 and the smallest of these is 1, so a(1)=1.
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Table[(18 n + (-1)^n - 1)/4, {n, 2, 50}]]
  • PARI
    a(n)=if(n<2,1,9*n\2);
    vector(50,n,a(n))

Formula

G.f.: x*(1 + 8*x + 3*x^2 - 3*x^3)/((1 - x)^2*(1 + x)).
a(n) = floor(9*n/2) = (18*n + (-1)^n - 1)/4 with n>1, a(1)=1.
a(n) = a(n-1) + a(n-2) - a(n-3) for n>4.
a(n) = -A130877(-n+1) for n>1.

Extensions

Edited by Bruno Berselli, Oct 30 2015

A382531 Number of n-digit base-10 numbers whose digit sum is equal to ceiling(9*n/2).

Original entry on oeis.org

1, 9, 70, 615, 5520, 50412, 468448, 4379055, 41395240, 392406145, 3748943890, 35866068766, 345143007910, 3323483518810, 32150758083580, 311088525668335, 3021445494584902, 29344719005694973, 285904843977651598, 2785022004925340460, 27203012941819689340
Offset: 1

Views

Author

Miquel Cerda, Mar 30 2025

Keywords

Comments

Digit sum ceiling(9*n/2) = A130877(n+1) has highest frequency among all n-digit base-10 numbers.
The count excludes numbers with leading zeros.

Examples

			a(2) = 9, the 2-digit numbers with digit sum 9 are: 18, 27, 36, 45, 54, 63, 72, 81, 90.
		

Crossrefs

Cf. A210736 (analogous for base-2 digits).
Cf. A025015 (maximal coefficient of (1+...+x^9)^n).

Programs

  • Maple
    b:= proc(n, s, t) option remember; `if`(9*n b(n, ceil(9*n/2), 1):
    seq(a(n), n=1..23);  # Alois P. Heinz, Apr 12 2025

Formula

a(n) = [x^ceiling(9*n/2)] (f^n - f^(n-1)) with f = (x^10-1)/(x-1). - Alois P. Heinz, Apr 12 2025

A120740 Numbers n such that n = Sum_digits[k*abs(n-k)] for some k>=0.

Original entry on oeis.org

0, 4, 5, 9, 14, 18, 23, 27, 32, 36, 41, 45, 50, 54, 59, 63, 68, 72, 77, 81, 86, 90, 95, 99, 104, 108, 113, 117, 122, 126, 131, 135, 140, 144, 149, 153, 158, 162, 167, 171, 176, 180, 185, 189, 194, 198, 203, 207, 212, 216, 221, 225, 230, 234, 239, 243, 248, 252
Offset: 1

Views

Author

Keywords

Comments

The first difference is eventually 2-periodic: 4, 1, 4, 5, 4, 5, 4, etc. The minimum numbers k associated to the first elements of the sequence are (n,k): (0,0), (4,2), (5,7), (9,3), (14,19), (18,33), (23,67), (27,69), etc.

Examples

			n = 36 -> k = 279 -> 279*abs(36-279)=279*243=67797 -> 6+7+7+9+7 = 36
		

Crossrefs

Cf. A130877.

Programs

  • Maple
    P:=proc(n) local i, j, k, w; for i from 0 by 1 to n do for j from 0 by 1 to 100*n do w:=0; k:=j*abs(i-j); while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; if w=i then print(i); break; fi; od; od; end: P(100000);

Formula

Conjecture: a(n) = (18*n-(-1)^n-35)/4 for n>2. a(n) = a(n-1)+a(n-2)-a(n-3) for n>5. G.f.: x^2*(4+x+4*x^3)/((1-x)^2*(1+x)). [Colin Barker, Apr 10 2012]
Showing 1-3 of 3 results.