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.

A076042 a(0) = 0; thereafter a(n) = a(n-1) + n^2 if a(n-1) < n^2, otherwise a(n) = a(n-1) - n^2.

Original entry on oeis.org

0, 1, 5, 14, 30, 5, 41, 90, 26, 107, 7, 128, 272, 103, 299, 74, 330, 41, 365, 4, 404, 845, 361, 890, 314, 939, 263, 992, 208, 1049, 149, 1110, 86, 1175, 19, 1244, 2540, 1171, 2615, 1094, 2694, 1013, 2777, 928, 2864, 839, 2955, 746, 3050, 649, 3149
Offset: 0

Views

Author

Amarnath Murthy, Oct 29 2002

Keywords

Comments

Does not return to zero within first 2^25000 =~ 10^7525 terms. Define an epoch as an addition followed by a sequence of (addition, subtraction) pairs. The first epoch has length 1 (+), the second 3 (++-), the third 5 (++-+-), and so forth (cf. A324792). The epoch lengths increase geometrically by about the square root of 3, and the value at the end of each epoch is the low value in the epoch. These observations lead to the Python program given. - Tomas Rokicki, Aug 31 2019
Using the Maple program in A324791, I confirmed that a(n) != 0 for 0 < n < 10^2394. See the a- and b-files in A325056 and A324791. - N. J. A. Sloane, Oct 03 2019
'Easy Recamán transform' of the squares. - Daniel Forgues, Oct 25 2019

Crossrefs

See also A325056, A324791, A324792.
Cf. A053461 ('Recamán transform' of the squares).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0,
          ((s, t)-> s+`if`(sAlois P. Heinz, Jan 11 2020
  • Mathematica
    a[0] = 0;
    a[n_] := a[n] = a[n-1] + If[a[n-1] < n^2, n^2, -n^2];
    a /@ Range[0, 50] (* Jean-François Alcover, Apr 11 2020 *)
  • PARI
    v=vector(50); v[1]=1; for(n=2,50,if(v[n-1]
    				

Extensions

More terms from Ralf Stephan, Mar 20 2003
a(0)=0 prepended, at the suggestion of Allan C. Wechsler, by N. J. A. Sloane, Aug 31 2019
Offset set to 0, to cohere with previous action of N. J. A. Sloane, by Allan C. Wechsler, Sep 08 2019

A330725 a(0) = 0; thereafter a(n) = a(n-1) + sigma(n) if sigma(n) > a(n-1), otherwise a(n) = a(n-1) - sigma(n), where sigma is the sum of divisors function A000203.

Original entry on oeis.org

0, 1, 4, 0, 7, 1, 13, 5, 20, 7, 25, 13, 41, 27, 3, 27, 58, 40, 1, 21, 63, 31, 67, 43, 103, 72, 30, 70, 14, 44, 116, 84, 21, 69, 15, 63, 154, 116, 56, 0, 90, 48, 144, 100, 16, 94, 22, 70, 194, 137, 44, 116, 18, 72, 192, 120, 0, 80, 170, 110, 278, 216, 120, 16
Offset: 0

Views

Author

Alois P. Heinz, Jan 11 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, ((s, t)-> s+
          `if`(s
    				
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[DivisorSigma[1,n+1]>a,a+DivisorSigma[1,n+1],a- DivisorSigma[ 1,n+1]]}; NestList[nxt,{0,0},70][[All,2]] (* Harvey P. Dale, May 14 2022 *)

A331165 a(n) = a(n-1) + p(n) if p(n) > a(n-1), otherwise a(n) = a(n-1) - p(n), where p is the partition function A000041 (assuming a(n) = 0 for n < 0).

Original entry on oeis.org

1, 0, 2, 5, 0, 7, 18, 3, 25, 55, 13, 69, 146, 45, 180, 4, 235, 532, 147, 637, 10, 802, 1804, 549, 2124, 166, 2602, 5612, 1894, 6459, 855, 7697, 16046, 5903, 18213, 3330, 21307, 42944, 16929, 48114, 10776, 55359, 2185, 65446, 140621, 51487, 157045, 32291, 179564
Offset: 0

Views

Author

Alois P. Heinz, Jan 11 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0, ((s, t)-> s+
         `if`(s
    				
  • Mathematica
    a[n_] := a[n] = If[n<0, 0, With[{a1 = a[n-1], p = PartitionsP[n]}, If[p>a1, a1 + p, a1 - p]]];
    a /@ Range[0, 70] (* Jean-François Alcover, Jan 05 2021 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(p = numbpart(n-1)); va[n] = va[n-1] - p; if (va[n] < 0, va[n] += 2*p);); va;} \\ Michel Marcus, Jan 06 2021
Showing 1-3 of 3 results.