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.

Previous Showing 21-30 of 32 results. Next

A227380 Doubling the first two of every four nonnegative numbers.

Original entry on oeis.org

0, 2, 2, 3, 8, 10, 6, 7, 16, 18, 10, 11, 24, 26, 14, 15, 32, 34, 18, 19, 40, 42, 22, 23, 48, 50, 26, 27, 56, 58, 30, 31, 64, 66, 34, 35, 72, 74, 38, 39, 80, 82, 42, 43, 88, 90, 46, 47, 96, 98, 50, 51, 104, 106, 54, 55, 112, 114
Offset: 0

Views

Author

Paul Curtz, Jul 09 2013

Keywords

Comments

a(n) and its differences:
0, 2, 2, 3, 8, 10, 6, 7, 16,...
2, 0, 1, 5, 2, -4, 1, 9, 2,...
-2, 1, 4, -3, -6, 5, 8, -7, -10,... see A103889(n)
3, 3, -7, -3, 11, 3, -15, -3, 19,...
0, -10, 4, 14, -8, -18, 12, 22, -16,...
-10, 14, 10,- 22, -10, 30, 10, -38, -10,... .
The inverse binomial transform is
b(n)=0, 2, -2, 3, 0, -10, 24, -28, 0, 72, -160, 176, 0,...
=(0, 1, -1, 1, 0, -1, 4, -4, 0, 4, -16, 16, 0,...) * a(n).

Crossrefs

Cf. A001477.

Programs

  • Mathematica
    {2#[[1]],2#[[2]],#[[3]],#[[4]]}&/@Partition[Range[0,60],4]//Flatten (* or *) LinearRecurrence[{2,-3,4,-3,2,-1},{0,2,2,3,8,10},60] (* Harvey P. Dale, Dec 14 2021 *)

Formula

a(n) = n*A130658(n+2) = 2*A227316(n)/(n+1).
a(n) - a(n-4) = period 4:repeat 8, 8, 4, 4 = 4*A130658(n+2).
G.f.: (x^5 + 5*x^3 - 2*x^2 + 2*x)/((1-x)^2 * (1+x^2)^2). - Ralf Stephan, Jul 13 2013

A298364 Permutation of the natural numbers partitioned into quadruples [4k-2, 4k-1, 4k-3, 4k] for k > 0.

Original entry on oeis.org

2, 3, 1, 4, 6, 7, 5, 8, 10, 11, 9, 12, 14, 15, 13, 16, 18, 19, 17, 20, 22, 23, 21, 24, 26, 27, 25, 28, 30, 31, 29, 32, 34, 35, 33, 36, 38, 39, 37, 40, 42, 43, 41, 44, 46, 47, 45, 48, 50, 51, 49, 52, 54, 55, 53, 56, 58, 59, 57, 60, 62, 63, 61, 64, 66, 67, 65
Offset: 1

Views

Author

Guenther Schrack, Jan 18 2018

Keywords

Comments

Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the first and second elements, then swap the second and third elements; repeat for all quadruples.

Crossrefs

Inverse: A292576.
Sequence of fixed points: A008586(n) for n > 0.
First differences: (-1)^floor(n^2/4)*A068073(n-1) for n > 0.
Subsequences:
elements with odd index: A042963(A103889(n)) for n > 0.
elements with even index A014601(n) for n > 0.
odd elements: A166519(n-1) for n > 0.
indices of odd elements: A042964(n) for n > 0.
even elements: A005843(n) for n > 0.
indices of even elements: A042948(n) for n > 0.
Other similar permutations: A116966, A284307, A292576.

Programs

  • MATLAB
    a = [2 3 1 4];
    max = 10000;    % Generation of b-file.
    for n := 5:max
       a(n) = a(n-4) + 4;
    end;
    
  • Mathematica
    Nest[Append[#, #[[-4]] + 4] &, {2, 3, 1, 4}, 63] (* or *)
    Array[# + ((-1)^# + ((-1)^(# (# - 1)/2)) (1 - 2 (-1)^#))/2 &, 67] (* Michael De Vlieger, Jan 23 2018 *)
    LinearRecurrence[{1,0,0,1,-1},{2,3,1,4,6},70] (* Harvey P. Dale, Dec 12 2018 *)
  • PARI
    for(n=1, 100, print1(n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2, ", "))

Formula

O.g.f.: (3*x^3 - 2*x^2 + x + 2)/(x^5 - x^4 - x - 1).
a(1) = 2, a(2) = 3, a(3) = 1, a(4) = 4, a(n) = a(n-4) + 4 for n > 4.
a(n) = n + ((-1)^n + ((-1)^(n*(n-1)/2))*(1 - 2*(-1)^n))/2.
a(n) = n + (cos(n*Pi) - cos(n*Pi/2) + 3*sin(n*Pi/2))/2.
a(n) = 2*floor((n+1)/2) - 4*floor((n+1)/4) + floor(n/2) + 2*floor(n/4).
a(n) = n + (-1)^floor((n-1)^2/4)*A140081(n) for n > 0.
a(n) = A056699(n+1) - 1, n > 0.
a(n+2) = A168269(n+1) - a(n), n > 0.
a(n+2) = a(n) + (-1)^floor((n+1)^2/4)*A132400(n+2) for n > 0.
Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
First differences: periodic, (1, -2, 3, 2) repeat.
Compositions:
a(n) = A080412(A116966(n-1)) for n > 0.
a(n) = A284307(A256008(n)) for n > 0.
a(A067060(n)) = A133256(n) for n > 0.
A116966(a(n+1)-1) = A092486(n) for n >= 0.
A056699(a(n)) = A256008(n) for n > 0.

A307613 Inverse of the permutation A307485: one odd, two even, four odd, eight even, etc; extended with a(0) = 0.

Original entry on oeis.org

0, 1, 2, 4, 3, 5, 8, 6, 9, 7, 10, 16, 11, 17, 12, 18, 13, 19, 14, 20, 15, 21, 32, 22, 33, 23, 34, 24, 35, 25, 36, 26, 37, 27, 38, 28, 39, 29, 40, 30, 41, 31, 42, 64, 43, 65, 44, 66, 45, 67, 46, 68, 47, 69, 48, 70, 49, 71, 50, 72, 51, 73, 52, 74, 53, 75, 54, 76, 55, 77
Offset: 0

Views

Author

M. F. Hasler, Apr 18 2019

Keywords

Comments

See A307485 for further information, motivation & references.
Also, a(n) is the smallest k not yet in the sequence such that bitxor(k,a(n-1)) >= a(n-1). - Giorgos Kalogeropoulos, May 31 2019

Examples

			  Index n : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
A307485(n): 0, 1, 2, 4, 3, 5, 7, 9, 6, 8, ...
This sequence, the inverse permutation, is obtained by reading the above "from bottom to top", i.e., find the index in 2nd row, return the number above it: e.g., a(3) = 4, a(4) = 3, a(5) = 5, a(6) = 8, a(7) = 6, etc.
		

Crossrefs

Cf. A307485 (inverse permutation), A307612 (partial sums thereof).
Cf. A103889 (odd & even swapped), A004442 (pairs reversed: n + (-1)^n).
Odd numbers: A005408. Even numbers: A005843.
Cf. A233275 (different permutation based on entangling odd & even numbers).

Programs

  • Mathematica
    a[1]=1; a[n_] := a[n] = (t=1; While[BitXor[a[n-1],t] < a[n-1] || MemberQ[Array[a, n-1], t], t++]; t)
    Join[{0}, Table[a[k], {k,100}]]  (* Giorgos Kalogeropoulos, May 31 2019 *)
  • PARI
    my(A=apply(A307485,[1..99]), B=vecsort(A,,1)); for(i=1,#B,A[B[i]]==i||return(A307613=B[1..i-1]))

A121496 Run lengths of successive numbers in A068225.

Original entry on oeis.org

1, 2, 2, 1, 3, 4, 4, 3, 5, 6, 6, 5, 7, 8, 8, 7, 9, 10, 10, 9, 11, 12, 12, 11, 13, 14, 14, 13, 15, 16, 16, 15, 17, 18, 18, 17, 19, 20, 20, 19, 21, 22, 22, 21, 23, 24, 24, 23, 25, 26, 26, 25, 27, 28, 28, 27, 29, 30, 30, 29, 31, 32, 32, 31, 33, 34, 34, 33, 35, 36, 36, 35, 37, 38, 38
Offset: 1

Views

Author

Rick L. Shepherd, Aug 03 2006

Keywords

Comments

A000027 and A103889 are bisections.

Examples

			The fifth run of successive numbers in A068225 is 8, 9, 10 with run length three so a(5) = 3.
		

Crossrefs

Programs

  • Mathematica
    Rest@ CoefficientList[Series[x (1 + x - x^3 + x^4)/((1 - x)^2*(1 + x) (1 + x^2)), {x, 0, 75}], x] (* Michael De Vlieger, Oct 02 2017 *)
  • PARI
    a(n) = if(n%2==1,(n+1)/2,if(n%4==0,(n/2)-1,(n/2)+1))
    for(n=1,80,print1(a(n),", "))
    
  • PARI
    Vec(x*(1+x-x^3+x^4)/((1-x)^2*(1+x)*(1+x^2)) + O(x^100)) \\ Colin Barker, Apr 08 2016

Formula

a(2*k-1) = k, a(4*k) = 2*k-1, a(4*k-2) = 2*k, for k >= 1.
From Colin Barker, Apr 08 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: x*(1+x-x^3+x^4) / ((1-x)^2*(1+x)*(1+x^2)). (End)
a(n) = (2*n+1-4*cos(n*Pi/2)-cos(n*Pi))/4. - Wesley Ivan Hurt, Oct 02 2017

A123246 a(n) = PrimePi(n) + (-1)^(PrimePi(n) + 1) (cf. A000720).

Original entry on oeis.org

-1, 2, 1, 1, 4, 4, 3, 3, 3, 3, 6, 6, 5, 5, 5, 5, 8, 8, 7, 7, 7, 7, 10, 10, 10, 10, 10, 10, 9, 9, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 14, 14, 13, 13, 13, 13, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 18, 18, 17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 19, 19, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23
Offset: 1

Views

Author

Roger L. Bagula, Oct 07 2006

Keywords

References

  • Lynn Arthur Steen and J. Arthur Seebach, Jr., Counterexamples in Topology, Dover, New York, 1978, page 134.

Crossrefs

Programs

  • Mathematica
    f[n_] = PrimePi[n] + (-1)^(PrimePi[n] + 1); Table[f[n], {n, 1, 200}]
  • PARI
    a(n) = primepi(n) + (-1)^(primepi(n) + 1); \\ Michel Marcus, Oct 12 2018

Extensions

Edited by N. J. A. Sloane, Oct 08 2006

A163975 n-th nonprime - (-1)^(n-th nonprime).

Original entry on oeis.org

-1, 2, 3, 5, 7, 10, 9, 11, 13, 16, 15, 17, 19, 22, 21, 23, 26, 25, 28, 27, 29, 31, 34, 33, 36, 35, 37, 40, 39, 41, 43, 46, 45, 47, 50, 49, 52, 51, 53, 56, 55, 58, 57, 59, 61, 64, 63, 66, 65, 67, 70, 69, 71, 73, 76, 75, 78, 77, 79, 82, 81, 83, 86, 85, 88, 87, 89, 92, 91, 94, 93
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 07 2009

Keywords

Examples

			a(1)=0-(-1)^0=-1. a(2)=1-(-1)^1=2.
		

Crossrefs

Cf. A141468.

Programs

  • Maple
    A103889 := proc(n) n-(-1)^n ; end:
    A141468 := proc(n) option remember ; if n <= 2 then n-1 ; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a); fi; od: fi; end:
    A163975 := proc(n) A103889(A141468(n)) ; end: seq( A163975(n),n=1..120) ;
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; Table[nonPrime[n] - (-1)^(nonPrime[n]), {n, 0, 50}] (* G. C. Greubel, Aug 24 2017 *)
  • PARI
    for(n=1,1e3,if(!isprime(n), print1(n - (-1)^n", "))) \\ Charles R Greathouse IV, Jun 10 2015

Formula

a(n) = A141468(n) - (-1)^A141468(n).
a(n) = A103889(A141468(n)), n>0.

Extensions

Entries checked by R. J. Mathar, Aug 29 2009

A226279 a(4n) = a(4n+2) = 2*n , a(4n+1) = a(4n+3) = 2*n-1.

Original entry on oeis.org

0, -1, 0, -1, 2, 1, 2, 1, 4, 3, 4, 3, 6, 5, 6, 5, 8, 7, 8, 7, 10, 9, 10, 9, 12, 11, 12, 11, 14, 13, 14, 13, 16, 15, 16, 15, 18, 17, 18, 17, 20, 19, 20, 19, 22, 21, 22, 21, 24, 23, 24, 23, 26, 25, 26, 25, 28, 27, 28, 27, 30, 29, 30, 29
Offset: 0

Views

Author

Paul Curtz, Jun 02 2013

Keywords

Comments

a(n)=c(n) in A214297(n).
In A214297 d(n)=-1,1,1,3,1,3,3,... = mix (-A186422(2n) , A186422(2n+1)).
A214297 is the (reduced) numerator of 1/4 - 1/A061038(n).
(i.e. (1/4 -(1/0, 1/4, 1, 1/36, 1/16,...)) = -1/0, 0/1, -3/4, 2/9, 3/16,... )
1/0 is a convention.
n^2=(a(n+1)+d(n+1))^2 are the denominators.

Crossrefs

Programs

Formula

a(0) = a(2)=0, a(1)=a(3)=-1, a(4)=2.
a(n) = a(n-4) + 2, n > 3.
a(n) = a(n-1) + a(n-4) - a(n-5), n > 4.
A214297(n) = a(n+1) * d(n+1).
G.f.: x*(3*x^3-x^2+x-1) / ((x-1)^2*(x+1)*(x^2+1)). - Colin Barker, Sep 22 2013

A342769 Pairwise listing of the partitions of 2k into two parts, (s,t), with 0 < s <= t ordered by increasing values of s and where k = 1,2,... .

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 1, 5, 2, 4, 3, 3, 1, 7, 2, 6, 3, 5, 4, 4, 1, 9, 2, 8, 3, 7, 4, 6, 5, 5, 1, 11, 2, 10, 3, 9, 4, 8, 5, 7, 6, 6, 1, 13, 2, 12, 3, 11, 4, 10, 5, 9, 6, 8, 7, 7, 1, 15, 2, 14, 3, 13, 4, 12, 5, 11, 6, 10, 7, 9, 8, 8, 1, 17, 2, 16, 3, 15, 4, 14, 5, 13, 6, 12, 7
Offset: 1

Views

Author

Wesley Ivan Hurt, Mar 21 2021

Keywords

Examples

			                                                        [1,13]
                                               [1,11]   [2,12]
                                       [1,9]   [2,10]   [3,11]
                               [1,7]   [2,8]   [3, 9]   [4,10]
                       [1,5]   [2,6]   [3,7]   [4, 8]   [5, 9]
               [1,3]   [2,4]   [3,5]   [4,6]   [5, 7]   [6, 8]
       [1,1]   [2,2]   [3,3]   [4,4]   [5,5]   [6, 6]   [7, 7]
   2k    2       4       6       8       10      12       14
  --------------------------------------------------------------------------
   2k   Nondecreasing partitions of 2k
  --------------------------------------------------------------------------
   2   1,1
   4   1,3,2,2
   6   1,5,2,4,3,3
   8   1,7,2,6,3,5,4,4
  10   1,9,2,8,3,7,4,6,5,5
  12   1,11,2,10,3,9,4,8,5,7,6,6
  14   1,13,2,12,3,11,4,10,5,9,6,8,7,7
  ...
		

Crossrefs

Formula

a(n) = k + (k^2 + k - m)*(-1)^n / 2, where k = round(sqrt(m)) and m = 2*floor((n+1)/2).
a(n) = A342913(A103889(n)). - Wesley Ivan Hurt, May 09 2021

A342913 Pairwise listing of the partitions of 2k into two parts, (s,t), with 0 < t <= s ordered by decreasing values of s and where k = 1,2,... .

Original entry on oeis.org

1, 1, 3, 1, 2, 2, 5, 1, 4, 2, 3, 3, 7, 1, 6, 2, 5, 3, 4, 4, 9, 1, 8, 2, 7, 3, 6, 4, 5, 5, 11, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 6, 13, 1, 12, 2, 11, 3, 10, 4, 9, 5, 8, 6, 7, 7, 15, 1, 14, 2, 13, 3, 12, 4, 11, 5, 10, 6, 9, 7, 8, 8, 17, 1, 16, 2, 15, 3, 14, 4, 13, 5, 12, 6, 11, 7
Offset: 1

Views

Author

Wesley Ivan Hurt, Mar 28 2021

Keywords

Examples

			                                                        [13,1]
                                               [11,1]   [12,2]
                                       [9,1]   [10,2]   [11,3]
                               [7,1]   [8,2]   [9, 3]   [10,4]
                       [5,1]   [6,2]   [7,3]   [8, 4]   [9, 5]
               [3,1]   [4,2]   [5,3]   [6,4]   [7, 5]   [8, 6]
       [1,1]   [2,2]   [3,3]   [4,4]   [5,5]   [6, 6]   [7, 7]
   2k    2       4       6       8       10      12       14
  --------------------------------------------------------------------------
   2k   Decreasing partitions of 2k
  --------------------------------------------------------------------------
   2   1,1
   4   3,1,2,2
   6   5,1,4,2,3,3
   8   7,1,6,2,5,3,4,4
  10   9,1,8,2,7,3,6,4,5,5
  12   11,1,10,2,9,3,8,4,7,5,6,6
  14   13,1,12,2,11,3,10,4,9,5,8,6,7,7
  ...
		

Crossrefs

Formula

a(n) = k - (k^2 + k - m)*(-1)^n / 2, where k = round(sqrt(m)) and m = 2*floor((n+1-(-1)^n)/2).
a(n) = A342769(A103889(n)).

A366423 Multiplicative with a(p^e) = p^(e+1-p) if p|e, and p^(e+1) otherwise.

Original entry on oeis.org

1, 4, 9, 2, 25, 36, 49, 16, 27, 100, 121, 18, 169, 196, 225, 8, 289, 108, 361, 50, 441, 484, 529, 144, 125, 676, 3, 98, 841, 900, 961, 64, 1089, 1156, 1225, 54, 1369, 1444, 1521, 400, 1681, 1764, 1849, 242, 675, 2116, 2209, 72, 343, 500, 2601, 338, 2809, 12, 3025
Offset: 1

Views

Author

Amiram Eldar, Nov 17 2023

Keywords

Comments

A permutation of the positive integers. 1 is the only fixed point.
a(n) is a powerful number (A001694) if and only if n is not in A100717.

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(e + 1 + If[Mod[e, p] == 0, -p, 0]); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i,1]^(f[i,2] + 1 + if(!(f[i,2]%f[i,1]), -f[i,1])));}

Formula

a(2^e) = 2^A103889(e).
a(3^e) = 3^A130508(e).
A007947(a(n)) = A007947(n).
a(A051674(n)) = A000040(n).
a(n) is squarefree (A005117) if and only if n is in A048102.
a(A048102(n)) = A007947(A048102(n)).
a(n) == 0 (mod n) if and only if n is not in A342090.
a(n) | n if and only if n is in A072873.
Sum_{k=1..n} a(k) ~ c * n^3 / 3, where c = Product_{p prime} (1 - 1/p + 1/(1 + p) - (p-1)/(p^p * (1 + p^p))) = 0.660264348361... .
Previous Showing 21-30 of 32 results. Next