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.

A333001 The average path sum (floored down) when iterating from n to 1 with nondeterministic map k -> k - k/p, where p is any prime factor of k.

Original entry on oeis.org

1, 3, 6, 7, 12, 12, 19, 15, 21, 23, 34, 25, 38, 37, 39, 31, 48, 41, 60, 46, 60, 63, 86, 50, 71, 71, 68, 71, 100, 74, 105, 63, 104, 89, 108, 81, 118, 112, 116, 90, 131, 112, 155, 119, 122, 153, 200, 101, 161, 132, 148, 135, 188, 131, 179, 137, 178, 181, 240, 144, 205, 192, 181, 127, 206, 191, 258, 170, 251, 199, 270, 160, 233, 218, 216
Offset: 1

Views

Author

Antti Karttunen, Apr 06 2020

Keywords

Examples

			a(12): we have three alternative paths: {12, 8, 4, 2, 1}, {12, 6, 4, 2, 1} or {12, 6, 3, 2, 1}, with path sums 27, 25, 24, whose average is 76/3 = 25.333..., therefore a(12) = 25.
For n=15 we have five alternative paths from 15 to 1 (illustrated below) with path sums 37, 40, 42, 40, 39, whose average is 198/5 = 39.6, therefore a(15) = 39.
        15
       / \
      /   \
    10     12
    / \   / \
   /   \ /   \
  5     8     6
   \_   |  __/|
     \__|_/   |
        4     3
         \   /
          \ /
           2
           |
           1.
		

Crossrefs

Cf. A333002/A333003 (average as exact rational, numerator/denominator in lowest terms), A333785 (where the average is an integer).
Cf. A333790 (smallest path sum), A333794 (conjectured largest path sum).

Programs

  • Mathematica
    Map[Floor@ Mean[Total /@ #] &, #] &@ Nest[Function[{a, n}, Append[a, Join @@ Table[Flatten@ Prepend[#, n] & /@ a[[n - n/p]], {p, FactorInteger[n][[All, 1]]}]]] @@ {#, Length@ # + 1} &, {{{1}}}, 74] (* Michael De Vlieger, Apr 15 2020 *)
  • PARI
    up_to = 20000;
    A333001list(up_to) = { my(u=vector(up_to), v=vector(up_to)); u[1] = v[1] = 1; for(n=2,up_to, my(ps=factor(n)[, 1]~); u[n] = vecsum(apply(p -> u[n-n/p], ps)); v[n] = (u[n]*n)+vecsum(apply(p -> v[n-n/p], ps))); vector(up_to, n, floor(v[n]/u[n])); };
    v333001 = A333001list(up_to);
    A333001(n) = v333001[n];

Formula

a(n) = floor(A333000(n)/A333123(n)) = floor(A333002(n)/A333003(n)).

A333785 Numbers m such that the average path sum is an integer when iterating from m to 1 with nondeterministic map k -> k - k/p, where p is any prime factor of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 14, 16, 17, 20, 25, 32, 50, 64, 68, 82, 83, 84, 100, 101, 125, 128, 162, 163, 170, 235, 243, 256, 257, 272, 289, 456, 457, 512, 548, 621, 1024, 1028, 1040, 2048, 4096, 4112, 7225, 8192, 8738, 9248, 13058, 16384, 16480, 16481, 17476, 17477, 32128, 32768, 65536, 65537, 131072, 132098, 262144, 262148, 264196
Offset: 1

Views

Author

Antti Karttunen, Apr 06 2020

Keywords

Comments

Numbers m such that A333123(m) divides A333000(m).
Positions of ones in A333003.

Crossrefs

Subsequences: A000079, A019434.

Programs

A333002 Numerator of the average path sum when iterating from n to 1 with nondeterministic map k -> k - k/p, where p is any prime factor of k.

Original entry on oeis.org

1, 3, 6, 7, 12, 25, 39, 15, 43, 47, 69, 76, 115, 37, 198, 31, 48, 209, 304, 46, 302, 317, 432, 203, 71, 500, 344, 640, 901, 899, 1271, 63, 1777, 179, 758, 736, 1069, 786, 465, 361, 525, 789, 1090, 358, 860, 1075, 1404, 506, 1132, 132, 1042, 815, 1133, 918, 1439, 965, 1251, 4165, 5522, 3026, 4307, 6343, 1273, 127
Offset: 1

Views

Author

Antti Karttunen, Apr 06 2020

Keywords

Crossrefs

See A333003 for denominator.

Programs

  • Mathematica
    Map[Numerator@ Mean[Total /@ #] &, #] &@ Nest[Function[{a, n}, Append[a, Join @@ Table[Flatten@Prepend[#, n] & /@ a[[n - n/p]], {p, FactorInteger[n][[All, 1]]}]]] @@ {#, Length@ # + 1} &, {{{1}}}, 63] (* Michael De Vlieger, Apr 15 2020 *)
  • PARI
    up_to = 20000;
    A333002list(up_to) = { my(u=vector(up_to), v=vector(up_to)); u[1] = v[1] = 1; for(n=2,up_to, my(ps=factor(n)[, 1]~); u[n] = vecsum(apply(p -> u[n-n/p], ps)); v[n] = (u[n]*n)+vecsum(apply(p -> v[n-n/p], ps))); vector(up_to, n, numerator(v[n]/u[n])); };
    v333002 = A333002list(up_to);
    A333002(n) = v333002[n];

Formula

a(n) = numerator(A333000(n)/A333123(n)).
Showing 1-3 of 3 results.