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.

A326501 a(n) = Sum_{k=0..n} (-k)^k.

Original entry on oeis.org

1, 0, 4, -23, 233, -2892, 43764, -779779, 15997437, -371423052, 9628576948, -275683093663, 8640417354593, -294234689237660, 10817772136320356, -427076118244539019, 18019667955465012597, -809220593930871751580, 38537187481365665823844
Offset: 0

Views

Author

Seiichi Manyama, Sep 12 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0, (-n)^n+a(n-1)) end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Sep 12 2019
  • Mathematica
    RecurrenceTable[{a[0] == 1, a[n] == a[n-1] + (-n)^n}, a, {n, 0, 23}] (* Jean-François Alcover, Nov 27 2020 *)
  • PARI
    {a(n) = sum(k=0, n, (-k)^k)}
    
  • Python
    from itertools import accumulate, count, islice
    def A326501_gen(): # generator of terms
        yield from accumulate((-k)**k for k in count(0))
    A326501_list = list(islice(A326501_gen(),10)) # Chai Wah Wu, Jun 18 2022

Formula

a(n) = 1 + (-1)^n * A001099(n).

A343931 Numbers k such that Sum_{j=1..k} (-j)^j == 0 (mod k).

Original entry on oeis.org

1, 3, 4, 11, 131, 188, 324, 445, 3548, 8284, 201403, 253731, 564084, 1812500, 4599115
Offset: 1

Views

Author

Seiichi Manyama, May 04 2021

Keywords

Comments

Also numbers k such that k divides A001099(k).

Crossrefs

Programs

  • Mathematica
    q[n_] := Divisible[Sum[PowerMod[-k, k, n], {k, 1, n}], n]; Select[Range[8500], q] (* Amiram Eldar, May 04 2021 *)
  • PARI
    isok(n) = sum(k=1, n, Mod(-k, n)^k)==0;
    
  • Python
    from itertools import accumulate, count, islice
    def A343931_gen(): # generator of terms
        yield 1
        for i, j in enumerate(accumulate((-k)**k for k in count(1)),start=2):
            if j % i == 0:
                yield i
    A343931_list = list(islice(A343931_gen(),10)) # Chai Wah Wu, Jun 18 2022

Extensions

a(11)-a(13) from Chai Wah Wu, May 04 2021
a(14) from Martin Ehrenstein, May 05 2021
a(15) from Martin Ehrenstein, May 08 2021

A271427 a(n) = 7^n - a(n-1) for n>0, a(0)=0.

Original entry on oeis.org

0, 7, 42, 301, 2100, 14707, 102942, 720601, 5044200, 35309407, 247165842, 1730160901, 12111126300, 84777884107, 593445188742, 4154116321201, 29078814248400, 203551699738807, 1424861898171642, 9974033287201501, 69818233010410500, 488727631072873507, 3421093417510114542
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 13 2016

Keywords

Comments

In general, the ordinary generating function for the recurrence b(n) = k^n - b(n-1), where n>0 and b(0)=0, is k*x/((1 + x)*(1 - k*x)). This recurrence gives the closed form b(n) = k*(k^n - (-1)^n)/(k + 1).

Examples

			a(2) = 7^2 - a(2-1) = 49 - 7 = 42.
a(4) = 7^4 - a(4-1) = 2401 - 301 = 2100.
		

Crossrefs

Cf. similar sequences with the recurrence b(n) = k^n - b(n-1): A125122 (k=1), A078008 (k=2), A054878 (k=3), A109499 (k=4), A109500 (k=5), A109501 (k=6), this sequence (k=7), A093134 (k=8), A001099 (k=n).

Programs

  • Mathematica
    LinearRecurrence[{6, 7}, {0, 7}, 30]
    Table[7 (7^n - (-1)^n)/8, {n, 0, 30}]
  • PARI
    vector(50, n, n--; 7*(7^n-(-1)^n)/8) \\ Altug Alkan, Apr 13 2016
    
  • Python
    for n in range(0,10**2):print((int)((7*(7**n-(-1)**n))/8))
    # Soumil Mandal, Apr 14 2016

Formula

O.g.f.: 7*x/(1 - 6*x - 7*x^2).
E.g.f.: (7/8)*(exp(7*x) - exp(-x)).
a(n) = 6*a(n-1) + 7*a(n-2).
a(n) = 7*(7^n - (-1)^n)/8.
a(n) = 7*A015552(n).
Sum_{n>0} 1/(a(n) + a(n-1)) = 1/6 = A020793.
Limit_{n->oo} a(n-1)/a(n) = 1/7 = A020806.
Showing 1-3 of 3 results.