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.

User: Harri Aaltonen

Harri Aaltonen's wiki page.

Harri Aaltonen has authored 3 sequences.

A377535 First term of n-th differences of the sequence x^(x-1) for x >= 1.

Original entry on oeis.org

1, 1, 6, 42, 416, 5210, 79212, 1417094, 29168624, 679100562, 17645739500, 506235093782, 15893604725352, 542039221415354, 19954673671286564, 788708093950072830, 33312472504166976992, 1497371019734704549538, 71368260385615670087388, 3595248209512068272420582, 190872048208819769608101080
Offset: 0

Author

Harri Aaltonen, Oct 31 2024

Keywords

Comments

Inverse binomial transform of A000169.
It appears that a(n) is the number of partial functions f on [n] such that every point in [n] is either in the domain of f or in the image of f. Cf. A377763. - Geoffrey Critzer, Nov 06 2024

Crossrefs

Programs

  • Maple
    a:= n-> add((j+1)^j*(-1)^(n-j)*binomial(n,j), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Oct 31 2024
  • Mathematica
    With[{t = Table[n^(n - 1), {n, 1, 21}]}, Table[Sum[(-1)^(i - j) * Binomial[i, j] * t[[j + 1]], {j, 0, i}], {i, 0, Length[t] - 1}]] (* Amiram Eldar, Oct 31 2024 *)
  • PARI
    lista(nn) = my(v = vector(nn+1, n, n^(n-1)), vv=vector(nn+1)); vv[1] = v[1]; for (n=1, nn, my(w = vector(#v-1, k, v[k+1] - v[k])); vv[n+1] = w[1]; v = w;); vv; \\ Michel Marcus, Oct 31 2024

Formula

G.f.: Sum_{j>=1} A000169(j)*x^(j-1)/(1+x)^j. - Alois P. Heinz, Oct 31 2024

A128982 If in a line of n persons every n-th person is eliminated until only one person is left, which position P should one assume in the original lineup to avoid being eliminated?

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 2, 6, 6, 10, 2, 12, 2, 6, 8, 16, 2, 18, 2, 16, 18, 22, 2, 22, 12, 16, 8, 28, 2, 30, 2, 28, 18, 22, 12, 36, 2, 6, 8, 40, 2, 42, 2, 30, 42, 46, 2, 42, 14, 40, 30, 52, 2, 36, 24, 52, 54, 58, 2, 60, 2, 6, 30, 48, 24, 66, 2, 30, 18, 70, 2, 72, 2, 6, 20, 60, 18, 78, 2, 72, 78
Offset: 1

Author

Harri Aaltonen, Apr 30 2007

Keywords

Comments

The difference between this, A007495 and the diagonal of A032434 is that for each of the n-1 elimination processes, counting from 1 to n starts at the lowest position in the line that is still occupied, not right after the most recently eliminated position. Wrapping around when n exceeds the number of residual occupied positions still occurs in circular fashion as in the original Josephus problem. - R. J. Mathar, May 07 2007

Examples

			Elimination at n=6: 1,2,3,4,5,6 -> 1,2,3,4,5 -> 2,3,4,5 -> 2,4,5 -> 2,4 -> 2. After the 3 is eliminated, counting does not start at 4 but again at 2.
		

Crossrefs

Programs

  • C
    int a(int n) { if (n<3) return 1; int L=1, R=n-1, M, t, s, q, r; while (R>L+1) { s = M = (L+R)/2; t= n-1; while (s && sHagen von Eitzen, Nov 08 2022 */
  • Maple
    A128982 := proc(n) local l ; l := [seq(i,i=1..n)] ; for i from 1 to n-1 do rm := ((n-1) mod nops(l))+1 ; l := subsop(rm=NULL,l) ; od ; RETURN(op(1,l)) ; end: for n from 1 to 85 do printf("%d, ",A128982(n)) ; od ; # R. J. Mathar, May 07 2007
  • Mathematica
    a[n_] := Module[{l = Range[n]}, Do[l = Delete[l, Mod[n-1, Length[l]]+1], {n-1}]; If[l == {}, Nothing, l[[1]]]];
    a /@ Range[0, 100] (* Jean-François Alcover, Apr 01 2020 *)

Formula

If n is prime then P = n - 1. If n is prime + 1 then P = 2.

Extensions

This is a version of the Josephus problem. Several other versions are already in the OEIS. - N. J. A. Sloane, May 01 2007
Corrected and extended by R. J. Mathar, May 07 2007

A093652 Let a(1) = 1, a(2) = 2, a(3) = 7, a(4) = 15 and for n >= 5 set a(n) = (n*b(n) - b(n-2)) / 2, where b(n) = 4*b(n-2) - b(n-4) for n >= 5 and b(1) = 1, b(2) = 2, b(3) = 5, b(4) = 8.

Original entry on oeis.org

1, 2, 7, 15, 45, 86, 239, 433, 1157, 2034, 5307, 9151, 23497, 39974, 101467, 170913, 430089, 718946, 1796975, 2985775, 7422437, 12272502, 30373191, 50016721, 123327373, 202395986, 497484067, 814061151, 1995542913, 3257222726, 7965875891, 12973832257, 31663779857
Offset: 1

Author

Harri Aaltonen, May 15 2004, Apr 12 2008

Keywords

Comments

a(n)/b(n) gives the ohm value of a ladder of unit resistors measured from opposite corners. The ladder is best described as a line of n squares, where every segment has a resistance of 1 ohm.
1/(n - 2*a(n)/b(n)) approaches 2 + sqrt(3) as n increases.

Crossrefs

Cf. A082630.

Programs

  • Maple
    a_list := proc(last) local B, C, k;
       B := [1,2,5, 8];
       C := [1,2,7,15];
       for k from 5 to last do
          B := [op(B), 4*B[k-2]-B[k-4]];
          C := [op(C), (k*B[k]-B[k-2])/2];
       od;
    C end:
    a_list(50); # After Harri Aaltonen, Peter Luschny, Mar 14 2020
  • Mathematica
    LinearRecurrence[{0, 8, 0, -18, 0, 8, 0, -1}, {1, 2, 7, 15, 45, 86, 239, 433}, 50] (* Jean-François Alcover, Oct 24 2023 *)

Formula

Conjecture: b(n) = A082630(n). If true, we can write a(n) = (n*A082630(n) - A082630(n-2)) / 2.
From Colin Barker, Dec 20 2019: (Start)
G.f.: x*(1 + 2*x - x^2 - x^3 + 7*x^4 + 2*x^5 - 3*x^6 - x^7) / (1 - 4*x^2 + x^4)^2.
a(n) = 8*a(n-2) - 18*a(n-4) + 8*a(n-6) - a(n-8) for n>8.
(End)

Extensions

Edited by Peter Luschny, Jun 14 2021