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 11-20 of 62 results. Next

A162203 The mountain path of the primes (see comment lines for definition).

Original entry on oeis.org

2, 2, 2, 3, 1, -1, 1, 3, 1, -1, 1, 3, 1, -3, 1, 4, 1, -2, 1, 5, 1, -1, 1, 3, 1, -3, 1, 6, 1, -2, 1, 4, 1, -3, 1, 3, 1, -2, 1, 5, 1, -3, 1, 7, 1, -4, 1, 3, 1, -1, 1, 3, 1, -1, 1, 9, 1, -7, 1, 5, 1, -2, 1, 6, 1, -4, 1, 4, 1, -4, 1, 5, 1, -3, 1, 6, 1, -2, 1, 6
Offset: 1

Views

Author

Omar E. Pol, Jun 27 2009

Keywords

Comments

On the infinite square grid we draw an infinite straight line from the point (1,0) in direction (2,1).
We start at stage 1 from the point (0,0) drawing an edge ((0,0),(2,0)) in a horizontal direction.
At stage 2 we draw an edge ((2,0),(2,2)) in a vertical direction. We can see that the straight line intercepts at the number 3 (the first odd prime).
At stage 3 we draw an edge ((2,2),(4,2)) in a horizontal direction. We can see that the straight line intercepts at the number 5 (the second odd prime).
And so on (see illustrations).
The absolute value of a(n) is equal to the length of the n-th edge of a path, or infinite square polyedge, such that the mentioned straight line intercepts, on the path, at the number 1 and the odd primes. In other words, the straight line intercepts the odd noncomposite numbers (A006005).
The position of the x-th odd noncomposite number A006005(x) is represented by the point P(x,x-1).
So the position of the first prime number is represented by the point P(2,0) and position of the x-th prime A000040(x), for x>1, is represented by the point P(x,x-1); for example, 31, the 11th prime, is represented by the point P(11,10).
See also A162200, A162201 and A162202 for more information.

Examples

			Array begins:
=====
X..Y
=====
2, 2;
2, 3;
1,-1;
1, 3;
1,-1;
1, 3;
1,-3;
1, 4;
1,-2;
1, 5;
		

Crossrefs

Programs

  • PARI
    \\ (After Nathaniel Johnston_'s formula):
    A052288(n) = ((prime(n+3) - prime(n+1))/2);
    A162203(n) = if(n<=3, 2, if(n%2, 1, 1+((-1)^(n/2)*(A052288(n/2)-1)))); \\ Antti Karttunen, Mar 02 2023

Formula

From Nathaniel Johnston, May 10 2011: (Start)
a(2n+1) = 1 for n >= 2.
a(2n) = (-1)^n*(A162341(n+2) - 1) = (-1)^n*(A052288(n) - 1) + 1 for n >= 2. (End)

Extensions

Edited by Omar E. Pol, Jul 02 2009
More terms from Nathaniel Johnston, May 10 2011

A176997 Integers k such that 2^(k-1) == 1 (mod k).

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 08 2010

Keywords

Comments

Old definition was: Odd integers n such that 2^(n-1) == 4^(n-1) == 8^(n-1) == ... == k^(n-1) (mod n), where k = A062383(n). Dividing 2^(n-1) == 4^(n-1) (mod n) by 2^(n-1), we get 1 == 2^(n-1) (mod n), implying the current definition. - Max Alekseyev, Sep 22 2016
The union of {1}, the odd primes, and the Fermat pseudoprimes, i.e., {1} U A065091 U A001567. Also, the union of A006005 and A001567 (conjectured by Alois P. Heinz, Dec 10 2010). - Max Alekseyev, Sep 22 2016
These numbers were called "fermatians" by Shanks (1962). - Amiram Eldar, Apr 21 2024

Examples

			5 is in the sequence because 2^(5-1) == 4^(5-1) == 8^(5-1) == 1 (mod 5).
		

References

  • Daniel Shanks, Solved and Unsolved Problems in Number Theory, Spartan Books, Washington D.C., 1962.

Crossrefs

The odd terms of A015919.
Odd integers n such that 2^n == 2^k (mod n): this sequence (k=1), A173572 (k=2), A276967 (k=3), A033984 (k=4), A276968 (k=5), A215610 (k=6), A276969 (k=7), A215611 (k=8), A276970 (k=9), A215612 (k=10), A276971 (k=11), A215613 (k=12).

Programs

  • Mathematica
    m = 1; Join[Select[Range[m], Divisible[2^(# - 1) - m, #] &],
    Select[Range[m + 1, 10^3], PowerMod[2, # - 1, #] == m &]] (* Robert Price, Oct 12 2018 *)
  • PARI
    isok(n) = Mod(2, n)^(n-1) == 1; \\ Michel Marcus, Sep 23 2016
    
  • Python
    from itertools import count, islice
    def A176997_gen(startvalue=1): # generator of terms >= startvalue
        if startvalue <= 1:
            yield 1
        k = 1<<(s:=max(startvalue,1))-1
        for n in count(s):
            if k % n == 1:
                yield n
            k <<= 1
    A176997_list = list(islice(A176997_gen(),30)) # Chai Wah Wu, Jun 30 2022

Extensions

Edited by Max Alekseyev, Sep 22 2016

A162200 Number on the positive y axis of the n-th horizontal component in the graph of the "mountain path" function for prime numbers.

Original entry on oeis.org

0, 0, 2, 2, 5, 4, 7, 6, 9, 6, 10, 8, 13, 12, 15, 12, 18, 16, 20, 17, 20, 18, 23, 20, 27, 23, 26, 25, 28, 27, 36, 29, 34, 32, 38, 34, 38, 34, 39, 36, 42, 40, 46, 42, 45, 44, 51, 41, 49, 48, 51, 48, 52, 48, 56, 52, 58, 56, 60, 57, 60, 56, 68, 61, 64, 63, 72, 64, 72, 68, 71, 68, 75
Offset: 1

Views

Author

Omar E. Pol, Jun 28 2009

Keywords

Comments

Note that the n-th horizontal component is an edge with length equal to 1 (see the link: Graph of the mountain path function).
See A162201 for the first differences.

Crossrefs

Programs

Extensions

Edited by Omar E. Pol, Jul 02 2009
More terms from R. J. Mathar, Jul 15 2009

A162201 First differences of A162200.

Original entry on oeis.org

0, 2, 0, 3, -1, 3, -1, 3, -3, 4, -2, 5, -1, 3, -3, 6, -2, 4, -3, 3, -2, 5, -3, 7, -4, 3, -1, 3, -1, 9, -7, 5, -2, 6, -4, 4, -4, 5, -3, 6, -2, 6, -4, 3, -1, 7, -10, 8, -1, 3, -3, 4, -4, 8, -4, 6, -2, 4, -3, 3, -4, 12, -7, 3, -1, 9, -8, 8, -4, 3, -3, 7, -5, 6, -3, 5, -5, 6, -4, 9, -4, 6, -4, 4, -3
Offset: 1

Views

Author

Omar E. Pol, Jun 28 2009

Keywords

Comments

The absolute value of a(n) is also the length of the n-th vertical edge in the graph of the "mountain path" function for prime numbers.
See A162200 for the length of the n-th horizontal component.

Crossrefs

Programs

Formula

From R. J. Mathar, Jul 15 2009: (Start)
a(n) = A052288(n-1) if n >= 2, n even.
a(n) = 2 - A052288(n-1) if n >= 3, n odd. (End)

Extensions

Edited by Omar E. Pol, Jul 02 2009
More terms from R. J. Mathar, Jul 15 2009

A162202 Number of the n-th vertex in the graph of the "mountain path" function for prime numbers.

Original entry on oeis.org

0, 2, 4, 6, 9, 10, 11, 12, 15, 16, 17, 18, 21, 22, 25, 26, 30, 31, 33, 34, 39, 40, 41, 42, 45, 46, 49, 50, 56, 57, 59, 60, 64, 65, 68, 69, 72, 73, 75, 76, 81, 82, 85, 86, 93, 94, 98, 99, 102, 103, 104, 105, 108, 109, 110, 111, 120, 121, 128, 129, 134, 135
Offset: 0

Views

Author

Omar E. Pol, Jun 28 2009

Keywords

Comments

This sequence is formed by a zero together with the partial sums of the absolute values of A162203.

Crossrefs

Extensions

Edited by Omar E. Pol, Jul 02 2009
More terms from Nathaniel Johnston, May 10 2011

A162340 Number of "ON" cells at n-th stage in simple 2-dimensional cellular automaton whose virtual skeleton is a polyedge as the graph of the "mountain path" function for prime numbers.

Original entry on oeis.org

1, 2, 5, 6, 10, 12, 16, 18, 22, 26, 31, 34, 40, 42, 46, 50, 57, 60, 65, 69, 73, 76, 82, 86, 94, 99, 103, 105, 109, 111, 121, 129, 135, 138, 145, 150, 155, 160, 166, 170, 177, 180, 187, 192, 196, 198, 206, 217, 226, 228, 232, 236, 241, 246, 255, 260, 267, 270, 275, 279
Offset: 0

Views

Author

Omar E. Pol, Jul 01 2009

Keywords

Comments

a(n) is also the number of grid points that are covered after n-th stage by the same polyedge mentioned in the definition of this sequence.
Also, partial sums of A162341.

Crossrefs

Extensions

Edited by Omar E. Pol, Jul 05 2009
More terms from Nathaniel Johnston, Nov 06 2010

A162341 a(n) = number of grid points P(x,y) that are covered by a polyedge as the graph of the "mountain path" function for prime numbers, where x=n and y=0..oo.

Original entry on oeis.org

1, 1, 3, 1, 4, 2, 4, 2, 4, 4, 5, 3, 6, 2, 4, 4, 7, 3, 5, 4, 4, 3, 6, 4, 8, 5, 4, 2, 4, 2, 10, 8, 6, 3, 7, 5, 5, 5, 6, 4, 7, 3, 7, 5, 4, 2, 8, 11, 9, 2, 4, 4, 5, 5, 9, 5, 7, 3, 5, 4, 4, 5, 13, 8, 4, 2, 10, 9, 9, 5, 4, 4, 8, 6, 7, 4, 6, 6, 7, 5, 10, 5, 7, 5, 5, 4, 6, 6, 7, 2, 4, 7, 11, 5, 7, 5, 6, 8, 8, 9, 13, 7, 9
Offset: 0

Views

Author

Omar E. Pol, Jul 01 2009

Keywords

Comments

Se also A162340.

Crossrefs

Formula

a(n) = A052288(n-2) + (-1)^n for n>=3. [From Nathaniel Johnston, Nov 06 2010]

Extensions

Edited by Omar E. Pol, Jul 05 2009
More terms from Nathaniel Johnston, Nov 06 2010

A308077 G.f. A(x) satisfies: A(x) = x - A(x^2) + A(x^3) - A(x^4) + A(x^5) - A(x^6) + ...

Original entry on oeis.org

1, -1, 1, 0, 1, -3, 1, 0, 2, -3, 1, 2, 1, -3, 3, 0, 1, -8, 1, 2, 3, -3, 1, 0, 2, -3, 4, 2, 1, -13, 1, 0, 3, -3, 3, 10, 1, -3, 3, 0, 1, -13, 1, 2, 8, -3, 1, 0, 2, -8, 3, 2, 1, -20, 3, 0, 3, -3, 1, 18, 1, -3, 8, 0, 3, -13, 1, 2, 3, -13, 1, -4, 1, -3, 8, 2, 3, -13, 1
Offset: 1

Views

Author

Ilya Gutkovskiy, May 11 2019

Keywords

Crossrefs

Cf. A006005 (positions of 1's), A067856, A307776, A347031.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, add(a(n/d)*
         (-1)^(d-1), d=numtheory[divisors](n) minus {1}))
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Mar 30 2023
  • Mathematica
    terms = 79; A[] = 0; Do[A[x] = x + Sum[(-1)^(k + 1) A[x^k], {k, 2, terms}] + O[x]^(terms + 1) // Normal, terms + 1]; Rest[CoefficientList[A[x], x]]
    a[n_] := If[n == 1, n, Sum[If[d < n, (-1)^(n/d + 1) a[d], 0], {d, Divisors[n]}]]; Table[a[n], {n, 1, 79}]

Formula

a(1) = 1; a(n) = Sum_{d|n, d

A328167 GCD of the prime indices of n, all minus 1.

Original entry on oeis.org

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

Author

Gus Wiseman, Oct 08 2019

Keywords

Comments

Zeros are ignored when computing GCD, and the empty set has GCD 0.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			85 has prime indices {3,7}, so a(85) = GCD(2,6) = 2.
		

Crossrefs

Positions of 0's are A000079.
Positions of 1's are A328168.
Positions of records (first appearances) are A006005.
The GCD of the prime indices of n is A289508(n).
The GCD of the prime indices of n, all plus 1, is A328169(n).
Looking at divisors instead of prime indices gives A258409.
Partitions whose parts minus 1 are relatively prime are A328170.

Programs

  • Mathematica
    Table[GCD@@(PrimePi/@First/@If[n==1,{},FactorInteger[n]]-1),{n,100}]

A162345 Length of n-th edge in the graph of the zig-zag function for prime numbers.

Original entry on oeis.org

2, 2, 2, 3, 3, 3, 3, 3, 5, 4, 4, 5, 3, 3, 5, 6, 4, 4, 5, 3, 4, 5, 5, 7, 6, 3, 3, 3, 3, 9, 9, 5, 4, 6, 6, 4, 6, 5, 5, 6, 4, 6, 6, 3, 3, 7, 12, 8, 3, 3, 5, 4, 6, 8, 6, 6, 4, 4, 5, 3, 6, 12, 9, 3, 3, 9, 10, 8, 6, 3, 5, 7, 7, 6, 5, 5, 7, 6, 6, 9, 6, 6, 6, 4, 5, 5
Offset: 1

Author

Omar E. Pol, Jul 04 2009

Keywords

Comments

Also, first differences of A162800.
Also {2, 2, } together with the numbers A052288.
Note that the graph of the zig-zag function for prime numbers is similar to the graph of the mountain path function for prime numbers but with exactly a vertex between consecutive odd noncomposite numbers (A006005).
This is the same as A115061 if n>1 (and also essentially equal to A052288). Proof: Because this is the first differences of A162800, which is {0,2} together with A024675, this sequence (for n>=3) is given by a(n) = (prime(n+1) - prime(n-1))/2. Similarly, because half the numbers between prime(n-1) and prime(n+1) are closer to prime(n) than any other prime, A115061(n) = (prime(n+1) - prime(n-1))/2 for n>=3 as well. - Nathaniel Johnston, Jun 25 2011

Examples

			Array begins:
=====
x, y
=====
2, 2;
2, 3;
3, 3;
3, 3;
5, 4;
		

Programs

  • Magma
    [2,2] cat[(NthPrime(n+1)-NthPrime(n-1))/2: n in [3..80]]; // Vincenzo Librandi, Dec 19 2016
  • Maple
    A162345 := proc(n) if(n<=2)then return 2: fi: return (ithprime(n+1) - ithprime(n-1))/2: end: seq(A162345(n),n=1..100); # Nathaniel Johnston, Jun 25 2011
  • Mathematica
    Join[{2, 2}, Table[(Prime[n+1] - Prime[n-1])/2, {n, 3, 100}]] (* Vincenzo Librandi, Dec 19 2016 *)

Formula

a(n) = (prime(n+1) - prime(n-1))/2 for n>=3. - Nathaniel Johnston, Jun 25 2011

Extensions

Edited by Omar E. Pol, Jul 16 2009
Previous Showing 11-20 of 62 results. Next