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.

A368366 AGM transform of positive integers (see Comments for definition).

Original entry on oeis.org

0, 1, 54, 3856, 384375, 52173801, 9342271792, 2144652558336, 616093495529805, 217007162119140625, 92121505246667356416, 46444033776765696086016, 27459259766085858672714571, 18830590227539089561714381425, 14834398958231516437500000000000
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Comments

The AGM transform {AGM(n): n >= 1} is a measure of the difference between the arithmetic mean A(n) = S(n)/n and the geometric mean G(n) = P(n)^(1/n) of a sequence {a(n): n >= 1}, where S(n) = a(1)+...+a(n), P(n) = a(1)*...*a(n). It is given by AGM(n) = S(n)^n - n^n*P(n).
For odd n, these terms appear to be divisible by n^n; for even n, by (n/2)^n. Additional reductions may be possible. For example, with n = 7, 11, 15, 19, ..., 59, the terms are also divisible by these powers of two: 4, 8, 11, 16, 19, 23, 26, 32, 35, 39, 42, 47, 50, 54. - Hans Havermann, Jan 24 2024
Since a(n) = n^n*(((n+1)/2)^n-n!) = (n(n+1)/2)^n-n^n*n!, a(n) is divisible by n^n for odd n and divisible by (n/2)^n for even n. - Chai Wah Wu, Jan 25 2024

Crossrefs

See A368367-A368371, A369394 for further examples.
The AGM transform of (n mod 2) is A276978.
A368374 gives another way to look at the problem.

Programs

  • Maple
    AGM := proc(f,M) local b,n,S,P,i,t; b:=[];
    for n from 1 to M do
    S:=add(f(i),i=1..n); P:=mul(f(i),i=1..n); t:=S^n-n^n*P;
    b:=[op(b),t];
    od:
    b;
    end;
    fid:=proc(n) n; end; # the identity map
    AGM(fid,20);
  • Mathematica
    A368366[n_] := n^n (((n + 1)/2)^n - n!);
    Array[A368366, 10] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a368366(n) = {my(v=vector(n,i,i)); vecsum(v)^n - n^n*vecprod(v)}; \\ Hugo Pfoertner, Jan 24 2024
    
  • Python
    from itertools import count, islice
    def AGM(g): # generator of AGM transform of sequence given by generator g
        S, P = 0, 1
        for n, an in enumerate(g, 1):
            S += an
            P *= an
            yield S**n-n**n*P
    print(list(islice(AGM(count(1)), 15))) # Michael S. Branicky, Jan 24 2024
    
  • Python
    from math import factorial
    def A368366(n): return ((m:=n**n)*(n+1)**n>>n)-m*factorial(n) # Chai Wah Wu, Jan 25 2024

A206344 a(n) = floor(n/2)^n.

Original entry on oeis.org

0, 1, 1, 16, 32, 729, 2187, 65536, 262144, 9765625, 48828125, 2176782336, 13060694016, 678223072849, 4747561509943, 281474976710656, 2251799813685248, 150094635296999121, 1350851717672992089, 100000000000000000000, 1000000000000000000000, 81402749386839761113321
Offset: 1

Views

Author

Nathaniel Johnston, Feb 06 2012

Keywords

Comments

The sequence gives the number of (potentially unsolvable) "clock puzzles" with n positions in the video game Final Fantasy XIII-2.
Functions from [n] to [n] with f(i) even or f(i) = 1 for all i. - Olivier Gérard, Sep 23 2016
AGM transform of A059841. See A368366 for the definition of the AGM transform. - Alois P. Heinz, Jan 24 2024

Crossrefs

Cf. A206345, A206346, A276978, A276979 (other classes of endofunctions defined by image parity).

Programs

  • Magma
    [Floor(n/2)^n: n in [1..30]]; // G. C. Greubel, Mar 31 2023
    
  • Maple
    seq(floor(n/2)^n, n=1..50);
  • Mathematica
    Table[Floor[n/2]^n, {n,30}]
  • SageMath
    [(n//2)^n for n in range(1,31)] # G. C. Greubel, Mar 31 2023

A276979 a(n) = (floor(n/2)+1)^n.

Original entry on oeis.org

1, 4, 8, 81, 243, 4096, 16384, 390625, 1953125, 60466176, 362797056, 13841287201, 96889010407, 4398046511104, 35184372088832, 1853020188851841, 16677181699666569, 1000000000000000000, 10000000000000000000, 672749994932560009201
Offset: 1

Views

Author

Olivier Gérard, Sep 23 2016

Keywords

Comments

Functions from [n] to [n] with f(i) even or f(i) = 1 for all i.
Functions from [n] to [n] with f(i) odd or f(i) = n for all i.

Crossrefs

Programs

  • Mathematica
    Table[(Floor[n/2] + 1)^n, {n, 1, 20}]
  • PARI
    a(n) = (n\2 + 1)^n; \\ Michel Marcus, Oct 08 2016
Showing 1-3 of 3 results.