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-2 of 2 results.

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

Original entry on oeis.org

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

Views

Author

Guenther Schrack, Sep 19 2017

Keywords

Comments

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

Crossrefs

Inverse: A056699(n+1) - 1 for n > 0.
Sequence of fixed points: A008586(n) for n > 0.
Subsequences:
elements with odd index: A042964(A103889(n)) for n > 0.
elements with even index: A042948(n) for n > 0.
odd elements: A166519(n) for n>0.
indices of odd elements: A042963(n) for n > 0.
even elements: A005843(n) for n>0.
indices of even elements: A014601(n) for n > 0.
Sum of pairs of elements:
a(n+2) + a(n) = A163980(n+1) = A168277(n+2) for n > 0.
Difference between pairs of elements:
a(n+2) - a(n) = (-1)^A011765(n+3)*A091084(n+1) for n > 0.
Compound relations:
a(n) = A284307(n+1) - 1 for n > 0.
a(n+2) - 2*a(n+1) + a(n) = (-1)^A011765(n)*A132400(n+1) for n > 0.
Compositions:
a(n) = A116966(A080412(n)) for n > 0.
a(A284307(n)) = A256008(n) for n > 0.
a(A042963(n)) = A166519(n-1) for n > 0.
A256008(a(n)) = A056699(n) for n > 0.

Programs

  • MATLAB
    a = [3 1 2 4]; % Generate b-file
    max = 10000;
    for n := 5:max
       a(n) = a(n-4) + 4;
    end;
    
  • PARI
    for(n=1, 10000, print1(n + ((-1)^(n*(n-1)/2)*(2 - (-1)^n) - (-1)^n)/2, ", "))

Formula

a(1)=3, a(2)=1, a(3)=2, a(4)=4, a(n) = a(n-4) + 4 for n > 4.
O.g.f.: (2*x^3 + x^2 - 2*x + 3)/(x^5 - x^4 - x + 1).
a(n) = n + ((-1)^(n*(n-1)/2)*(2-(-1)^n) - (-1)^n)/2.
a(n) = n + (cos(n*Pi/2) - cos(n*Pi) + 3*sin(n*Pi/2))/2.
a(n) = n + n mod 2 + (ceiling(n/2)) mod 2 - 2*(floor(n/2) mod 2).
Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
First Differences, periodic: (-2, 1, 2, 3), repeat; also (-1)^A130569(n)*A068073(n+2) for n > 0.

A290812 Odd composite numbers m such that k^(m - 1) == 1 (mod m) and gcd(k^((m - 1)/2) - 1, m) = 1 for some integer k in the interval [2, sqrt(m) + 1].

Original entry on oeis.org

91, 247, 325, 343, 485, 703, 871, 901, 931, 949, 1099, 1111, 1157, 1247, 1261, 1271, 1387, 1445, 1525, 1649, 1765, 1807, 1891, 1975, 2047, 2059, 2071, 2117, 2501, 2701, 2863, 2871, 3277, 3281, 3365, 3589, 3845, 4069, 4141, 4187, 4291, 4371, 4411, 4525
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 11 2017

Keywords

Comments

If the condition "odd composite numbers" in the definition is replaced by "odd numbers", then every odd prime number is in the sequence.
This is not a subsequence of A290543 (for example, 65683 is missing in A290543).

Examples

			91 is in the sequence because:
1) it is an odd composite number.
2) k^90 == 1 (mod 91) and gcd(k^45 - 1, 91) = 1 with k = 10 < sqrt(91) + 1.
		

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [3..4525 by 2] do if not IsPrime(n) then for a in [2..Floor(Sqrt(n)+1)] do if Modexp(a, n-1, n) eq 1 and GCD(a^Truncate((n-1)/2)-1, n) eq 1 then Append(~lst, n); break; end if; end for; end if; end for; lst;
    
  • Mathematica
    Select[Range[3, 4525, 2], Function[n, And[CompositeQ@ n, AnyTrue[Range[2, Sqrt[n] + 1], And[PowerMod[#, n - 1, n] == 1, CoprimeQ[#^((n - 1)/2) - 1, n]] &]]]] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    is(n) = if(n > 1 && n%2==1 && !ispseudoprime(n), for(x=2, sqrt(n)+1, if(Mod(x, n)^(n-1)==1 && gcd(x^((n-1)/2)-1, n)==1, return(1)))); 0 \\ Felix Fröhlich, Aug 18 2017
Showing 1-2 of 2 results.