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.

A074171 a(1) = 1. For n >= 2, a(n) is either a(n-1)+n or a(n-1)-n; we use the minus sign only if a(n-1) is prime. E.g., since a(2)=3 is prime, a(3)=a(2)-3=0.

Original entry on oeis.org

1, 3, 0, 4, 9, 15, 22, 30, 39, 49, 60, 72, 85, 99, 114, 130, 147, 165, 184, 204, 225, 247, 270, 294, 319, 345, 372, 400, 429, 459, 490, 522, 555, 589, 624, 660, 697, 735, 774, 814, 855, 897, 940, 984, 1029, 1075, 1122, 1170, 1219, 1269, 1320, 1372, 1425, 1479
Offset: 1

Views

Author

Amarnath Murthy, Aug 30 2002

Keywords

Comments

In spite of the definition, this is simply 1, 3, then numbers of the form n*(n+7)/2 (A055999). In other words, a(n) = (n-3)*(n+4)/2 for n >= 3. The proof is by induction: For n > 3, a(n-1) = (n-4)*(n+3)/2 is composite, so a(n) = a(n-1) + n = (n-3)*(n+4)/2. - Dean Hickerson, T. D. Noe, Paul C. Leopardi, Labos Elemer and others, Oct 04 2004
If a 2-set Y and a 3-set Z, having one element in common, are subsets of an n-set X then a(n) is the number of 3-subsets of X intersecting both Y and Z. - Milan Janjic, Oct 03 2007

Examples

			a(1) = 1
a(2) = a(1) + 2 = 3, which is prime, so
a(3) = a(2) - 3 = 0, which is not prime, so
a(4) = a(3) + 4 = 4, which is not prime, etc.
		

Crossrefs

Programs

  • Mathematica
    {ta={1, 3}, tb={{0}}};Do[s=Last[ta]; If[PrimeQ[s], ta=Append[ta, s-n]]; If[ !PrimeQ[s], ta=Append[ta, s+n]]; Print[{a=Last[ta], b=(n-3)*(n+4)/2, a-b}]; tb=Append[tb, a-b], {n, 3, 100000}]; {ta, {tb, Union[tb]}} (* Labos Elemer, Oct 07 2004 *)

Formula

a(1) = 1, a(2) = 3; a(n+1) = a(n)+n if a(n) is not a prime; a(n+1) = a(n)-n if a(n) is prime.

Extensions

More terms from Jason Earls, Sep 01 2002
More terms from Labos Elemer, Oct 07 2004

A212427 a(n) = 17*n + A000217(n-1).

Original entry on oeis.org

0, 17, 35, 54, 74, 95, 117, 140, 164, 189, 215, 242, 270, 299, 329, 360, 392, 425, 459, 494, 530, 567, 605, 644, 684, 725, 767, 810, 854, 899, 945, 992, 1040, 1089, 1139, 1190, 1242, 1295, 1349, 1404, 1460, 1517, 1575, 1634, 1694, 1755, 1817, 1880, 1944, 2009
Offset: 0

Views

Author

Jesse Han, May 16 2012

Keywords

Comments

Generalization: T(n,i) = A000217(i-1+n) - A000217(i-1) = i*n + A000217(n-1); in this case is i=17. See also the comment in A212428.

Crossrefs

For n > 22, T(n,17) matches A074170 but with opposite sign.

Programs

  • Magma
    [n*(n+33)/2: n in [0..49]]; // Bruno Berselli, Jun 22 2012
    
  • Mathematica
    Table[-17 (17 - 1)/2 + (17 + n) (16 + n)/2, {n, 0, 100}]
  • PARI
    a(n)=n*(n+33)/2 \\ Charles R Greathouse IV, Jun 17 2017

Formula

a(n) = (16+n)*(17+n)/2 - 16*17/2 = 17*n + (n-1)*n/2 = n*(n+33)/2.
G.f.: x*(17-16*x)/(1-x)^3. - Bruno Berselli, Jun 22 2012
a(n) = 17*n - floor(n/2) + floor(n^2/2). - Wesley Ivan Hurt, Jun 15 2013
From Amiram Eldar, Jan 11 2021: (Start)
Sum_{n>=1} 1/a(n) = 2*A001008(33)/(33*A002805(33)) = 53676090078349/216605329340400.
Sum_{n>=1} (-1)^(n+1)/a(n) = 4*log(2)/33 - 14606816124167/340379803249200. (End)
From Elmo R. Oliveira, Dec 12 2024: (Start)
E.g.f.: exp(x)*x*(34 + x)/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A076543 a(n) = Sum_{k=1..n} k*sqf(k) where sqf(k)=1 if k is squarefree and sqf(k)=-1 otherwise.

Original entry on oeis.org

1, 3, 6, 2, 7, 13, 20, 12, 3, 13, 24, 12, 25, 39, 54, 38, 55, 37, 56, 36, 57, 79, 102, 78, 53, 79, 52, 24, 53, 83, 114, 82, 115, 149, 184, 148, 185, 223, 262, 222, 263, 305, 348, 304, 259, 305, 352, 304, 255, 205, 256, 204, 257, 203, 258, 202, 259, 317, 376, 316, 377
Offset: 1

Views

Author

Zak Seidov, Oct 19 2002

Keywords

Comments

Surprisingly, first 12 terms are also in A074170.

Crossrefs

Cf. A074170.

Programs

  • Mathematica
    Accumulate[Table[If[SquareFreeQ[n],n,-n],{n,70}]] (* Harvey P. Dale, Mar 18 2015 *)
  • PARI
    a(n) = sum(k = 1, n, if (issquarefree(k), k, -k)); \\ Michel Marcus, Oct 02 2013
Showing 1-3 of 3 results.