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-10 of 16 results. Next

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

A369394 AGM transform of the primes.

Original entry on oeis.org

0, 1, 190, 29761, 9991618, 3349024561, 1787557230622, 1073002497284641, 913569251212186570, 1211439486817121619201, 1701996355944048723430570, 3350440495714062711027347281, 7769260076569386601943106748798, 18992268581018658446853739996365841, 54445901270324824915088660223022735282
Offset: 1

Views

Author

Hugo Pfoertner, Jan 24 2024

Keywords

Comments

See A368366 for the definition of the AGM transform.

Crossrefs

Cf. A368366.

Programs

  • Mathematica
    A369394[n_] := With[{p = Prime[Range[n]]}, Total[p]^n - n^n*Apply[Times, p]];
    Array[A369394, 15] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a369394(n) = {my(v=primes(n)); vecsum(v)^n - n^n*vecprod(v)};
    
  • Python
    from sympy import prime, primorial
    def A369394(n): return sum(prime(i) for i in range(1,n+1))**n-n**n*primorial(n) # Chai Wah Wu, Jan 25 2024

A276978 a(n) = (ceiling(n/2))^n.

Original entry on oeis.org

1, 1, 8, 16, 243, 729, 16384, 65536, 1953125, 9765625, 362797056, 2176782336, 96889010407, 678223072849, 35184372088832, 281474976710656, 16677181699666569, 150094635296999121, 10000000000000000000, 100000000000000000000, 7400249944258160101211
Offset: 1

Views

Author

Olivier Gérard, Sep 23 2016

Keywords

Comments

Functions from [n] to [n] with f(i) odd for all i.
Apart from initial term first differs from A132377 at a(9).
With a(1) = 0: AGM transform of A000035. See A368366 for the definition of the AGM transform. - Alois P. Heinz, Jan 24 2024

Crossrefs

Cf. A206344, A276979 (other similar classes of endofunctions).

Programs

  • Mathematica
    Table[Ceiling[n/2]^n, {n, 1, 21}]
  • PARI
    a(n)= ceil(n/2)^n; \\ Michel Marcus, Oct 08 2016

A368367 AGM transform of factorials.

Original entry on oeis.org

0, 1, 405, 1112193, 83733135993, 442674314320893489, 252729042985343953175786217, 20874524971928676951126081870191637441, 321062452616441231930929630956482460885924054669273, 1152310647749051621143585533734466768135769634034830754169423308849
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Comments

See A368366 for further information.

Crossrefs

Programs

  • Mathematica
    A368367[n_] := With[{f = Range[n]!}, Total[f]^n - n^n*Apply[Times, f]];
    Array[A368367, 10] (* Paolo Xausa, Jan 29 2024 *)
  • Python
    from math import prod, factorial
    def A368367(n): return sum(factorial(i) for i in range(1,n+1))**n-n**n*prod(i**(n-i+1) for i in range(2,n+1)) # Chai Wah Wu, Jan 25 2024

A368371 AGM transform of powers of 2.

Original entry on oeis.org

0, 4, 1016, 547856, 813732832, 3903659417664, 67987041960443776, 4575641535535493153024, 1216334976081196096854162944, 1285452910821757852273429343896576, 5415346123378152397099190627515485911040, 91076602434014222291049466570765323207327092736
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Comments

See A368366 for further information.

Crossrefs

Cf. A368366.

Programs

A368372 a(n) = numerator of AM(n)-HM(n), where AM(n) and HM(n) are the arithmetic and harmonic means of the first n positive integers.

Original entry on oeis.org

0, 1, 4, 29, 111, 103, 472, 2369, 12965, 30791, 197346, 452993, 3337271, 7485915, 4160656, 18358463, 170991927, 124184839, 1278605110, 110351535, 98802055, 211524139, 2595194516, 16562041459, 219589922071, 464651871609, 2207044831642, 4649180818987, 70862100349605, 148699793966557
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Examples

			0, 1/6, 4/11, 29/50, 111/137, 103/98, 472/363, 2369/1522, 12965/7129, 30791/14762, 197346/83711, 452993/172042, 3337271/1145993, 7485915/2343466, 4160656/1195757, 18358463/4873118, ...
		

Crossrefs

Programs

  • Maple
    AM:=proc(n) local i; (add(i,i=1..n)/n); end;
    HM:=proc(n) local i; (add(1/i,i=1..n)/n)^(-1); end;
    s1:=[seq(AM(n)-HM(n),n=1..50)];
  • Mathematica
    A368372[n_] := Numerator[(n+1)/2 - n/HarmonicNumber[n]];
    Array[A368372, 35] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a368372(n) = numerator((n+1)/2 - n/harmonic(n)) \\ Hugo Pfoertner, Jan 25 2024
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen(): # generator of terms
        A = H = 0
        for n in count(1):
            A += n
            H += Fraction(1, n)
            yield ((A*Fraction(1, n) - n/H)).numerator
    print(list(islice(agen(), 30))) # Michael S. Branicky, Jan 24 2024
    
  • Python
    from fractions import Fraction
    from sympy import harmonic
    def A368372(n): return (Fraction(n+1,2)-Fraction(n,harmonic(n))).numerator # Chai Wah Wu, Jan 25 2024
    

A368373 a(n) = denominator of AM(n)-HM(n), where AM(n) and HM(n) are the arithmetic and harmonic means of the first n positive integers.

Original entry on oeis.org

1, 6, 11, 50, 137, 98, 363, 1522, 7129, 14762, 83711, 172042, 1145993, 2343466, 1195757, 4873118, 42142223, 28548602, 275295799, 22334054, 18858053, 38186394, 444316699, 2695645910, 34052522467, 68791484534, 312536252003, 630809177806, 9227046511387, 18609365660294, 290774257297357
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Examples

			0, 1/6, 4/11, 29/50, 111/137, 103/98, 472/363, 2369/1522, 12965/7129, 30791/14762, 197346/83711, 452993/172042, 3337271/1145993, 7485915/2343466, 4160656/1195757, 18358463/4873118, ...
		

Crossrefs

Programs

  • Maple
    AM:=proc(n) local i; (add(i,i=1..n)/n); end;
    HM:=proc(n) local i; (add(1/i,i=1..n)/n)^(-1); end;
    s1:=[seq(AM(n)-HM(n),n=1..50)];
  • Mathematica
    A368373[n_] := Denominator[(n+1)/2 - n/HarmonicNumber[n]];
    Array[A368373, 35] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a368373(n) = denominator((n+1)/2 - n/harmonic(n)) \\ Hugo Pfoertner, Jan 25 2024
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen(): # generator of terms
        A = H = 0
        for n in count(1):
            A += n
            H += Fraction(1, n)
            yield ((A*Fraction(1, n) - n/H)).denominator
    print(list(islice(agen(), 31))) # Michael S. Branicky, Jan 24 2024
    
  • Python
    from fractions import Fraction
    from sympy import harmonic
    def A368373(n): return (Fraction(n+1,2)-Fraction(n,harmonic(n))).denominator # Chai Wah Wu, Jan 25 2024
    

A368368 AGM transform of squares.

Original entry on oeis.org

0, 9, 1772, 662544, 458284375, 543682781641, 1033215730131200, 2972173255049281536, 12354182867688591966525, 71417932095699615712890625, 556289577698910589026958125056, 5685963330436142993425055664640000, 74579993174727714813743424870936891459
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Comments

See A368366 for further information.

Crossrefs

Cf. A368366.

Programs

  • Mathematica
    A368368[n_] := (n*(n+1)*(2*n+1)/6)^n - n^n*n!^2;
    Array[A368368, 15] (* Paolo Xausa, Jan 29 2024 *)
  • Python
    from math import factorial
    def A368368(n): return (n*(n+1)*((n<<1)+1)//6)**n-n**n*factorial(n)**2 # Chai Wah Wu, Jan 25 2024

A368374 a(n) = smallest k such that AM(k) - GM(k) >= n, where AM(k) and GM(k) are the arithmetic and geometric means of [1,...,k].

Original entry on oeis.org

1, 11, 19, 27, 35, 43, 50, 58, 66, 74, 81, 89, 97, 104, 112, 120, 127, 135, 143, 150, 158, 165, 173, 181, 188, 196, 204, 211, 219, 226, 234, 242, 249, 257, 264, 272, 280, 287, 295, 302, 310, 318, 325, 333, 340, 348, 356, 363, 371, 378, 386, 394, 401, 409, 416
Offset: 0

Views

Author

N. J. A. Sloane, Jan 27 2024, following a suggestion from Don Reble

Keywords

Comments

The difference d(x) = AM(1,2,3,...,x) - GM(1,2,3,...,x) increases. The first difference of d(x) approaches a limit, 1/2 - 1/e (0.13212...). So we could define a(n) to be the least x such that d(x) >= n. - Don Reble, Jan 27 2024. Which is what I did.

Examples

			The values of AM(i)-GM(i) for i = 1, ..., 11 are 0, 0.0857864376269049512, 0.1828794071678603411, 0.2866361605993568152, 0.3948289153026481077, 0.5062048344760910451, 0.6199848408587035501, 0.7356494004968713999, 0.8528337256030871195, 0.9712713118832352378, 1.0907612204156046410, so a(1) = 11.
		

Crossrefs

Programs

  • Maple
    Digits:=20;
    AM := proc(n) local i; add(i,i=1..n)/n; end;
    GM := proc(n) local i; mul(i,i=1..n)^(1/n); end;
    don := proc(n) evalf(AM(n) - GM(n)); end;
    a:=[1]; w:=1;
    for i from 1 to 300 do
       if don(i) >= w then a:=[op(a),i]; w:=w+1; fi;
    od:
    a;
  • Python
    from math import factorial
    def A368374(n):
        if n == 0: return 1
        m = (n<<1)-1
        kmin, kmax = m, m
        while factorial(kmax)< (kmax-m)**kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if factorial(kmid)<Chai Wah Wu, Jan 27 2024

Extensions

a(39)-a(54) from Alois P. Heinz, Jan 27 2024

A368369 AGM transform of odd numbers.

Original entry on oeis.org

0, 4, 324, 38656, 6812500, 1691793216, 566933589544, 247467140448256, 136744348012840296, 93452709250000000000, 77479910616937022101996, 76677271817228569527975936, 89338843947334074736463717884, 121104748419604219251183463776256, 189040371972603446582336425781250000, 336742459165125951045187297509382291456
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Comments

See A368366 for further information.

Crossrefs

Programs

  • Mathematica
    A368369[n_] := With[{m = n^n}, m*(m-(2*n-1)!!)];
    Array[A368369, 20] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a368369(n) = {my(v=vector(n, i, i+i-1)); vecsum(v)^n - n^n*vecprod(v)}; \\ Hugo Pfoertner, Jan 24 2024
    
  • Python
    from sympy import factorial2
    def A368369(n): return (m:=n**n)*(m-factorial2((n<<1)-1)) # Chai Wah Wu, Jan 25 2024
Showing 1-10 of 16 results. Next