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.

User: Andrea La Rosa

Andrea La Rosa's wiki page.

Andrea La Rosa has authored 3 sequences.

A359702 Odd primes p that are not congruent to 2*k modulo prime(k+1) for any positive integer k.

Original entry on oeis.org

3, 7, 31, 37, 43, 61, 67, 73, 157, 211, 271, 277, 331, 367, 421, 457, 571, 691, 823, 883, 997, 1093, 1201, 1237, 1303, 1657, 1783, 2053, 2287, 2347, 2371, 2377, 2557, 2803, 2971, 3001, 3061, 3067, 3307, 3313, 3391, 3967, 4021, 4231, 4273, 4357, 4447, 4561, 4603
Offset: 1

Author

Andrea La Rosa, Jan 11 2023

Keywords

Comments

This sequence arises from a more general study. First, consider a function f : P -> N (where P is the set of the odd prime numbers) such that 0 <= f(p) < p. Then, remove from the set P each prime number q such that q = f(p) (mod p) for some p.
For example, if f(p) = 0 for each p, then the final set is the empty set.
If f(p) = 1 for each p, then the final set seems to be the set of Fermat primes (empirical observation).
If f(p) = p-1, then the final set seems to be the set of Mersenne primes (empirical observation).
For the particular choice f(p) = 2k (where p is the k-th odd prime) this sequence is obtained.

Examples

			Terms in this sequence are those odd primes that are neither congruent to 2 (mod 3), nor congruent to 4 (mod 5), nor congruent to 6 (mod 7), nor congruent to 8 (mod 11), etc.
7 is a term because 7 == 1 (mod 3) and 7 == 2 (mod 5).
11 is not a term because 11 == 2 (mod 3).
13 is not a term because 13 == 6 (mod 7).
17 is not a term because 17 == 2 (mod 3).
19 is not a term because 19 == 8 (mod 11).
		

Crossrefs

Programs

  • PARI
    isok(p) = {if(!isprime(p)||p==2, 0, my(k=0); forprime(q=3, p-1, k+=2; if(p%q==k, return(0))); 1) } \\ Andrew Howroyd, Jan 11 2023

Extensions

Terms a(15) and beyond from Andrew Howroyd, Jan 11 2023

A355182 a(n) = t(n) - s(n) where s(n) = n*(n-1)/2 is the sum of the first n nonnegative integers and t(n) is the smallest sum of consecutive integers starting from n such that t(n) > s(n).

Original entry on oeis.org

1, 1, 4, 3, 1, 6, 3, 10, 6, 1, 10, 4, 15, 8, 21, 13, 4, 19, 9, 26, 15, 3, 22, 9, 30, 16, 1, 24, 8, 33, 16, 43, 25, 6, 35, 15, 46, 25, 3, 36, 13, 48, 24, 61, 36, 10, 49, 22, 63, 35, 6, 49, 19, 64, 33, 1, 48, 15, 64, 30, 81, 46, 10, 63, 26, 81, 43, 4, 61, 21, 80, 39, 100, 58, 15, 78, 34, 99
Offset: 1

Author

Andrea La Rosa, Jun 23 2022

Keywords

Comments

Record high values of a(n)/n approach sqrt(2) and occur at values of n that are terms of A011900; a(A011900(k)) = A046090(k). - Jon E. Schoenfield, Jun 23 2022
It appears that the sequence 1,2,4,5,6,8,... (the largest integer in the t(n) sum) is A288998. - Michel Marcus, Jun 24 2022

Examples

			a(6) = -s(6) + t(6):
s(6) is the sum of the first 6 nonnegative integers = 6*5 / 2 = 15.
t(6) is the smallest sum k of consecutive integers starting from n = 6 such that k > s(6) = 15.
The first few sets of consecutive integers starting from 6 are
  {6}, whose elements add up to 6,
  {6, 7}, whose elements add up to 13,
  {6, 7, 8}, whose elements add up to 21,
  {6, 7, 8, 9}, whose elements add up to 30,
  ...
the smallest sum that is > 15 is 21, so t(6) = 21, so a(6) = -15 + 21 = 6.
		

Crossrefs

Programs

  • JavaScript
    function a(n) {
        var sum = 0;
        for (var i = 0; i < n; i++)
            sum -= i;
        while (sum <= 0)
            sum += i++;
        return sum;
    }
    
  • PARI
    a(n) = my(t=0, s=n*(n-1)/2, k=n); until (t > s, t += k; k ++); t-s; \\ Michel Marcus, Jun 24 2022
    
  • Python
    from math import isqrt
    def A355182(n): return ((m:=(isqrt(((k:=n*(n-1))<<3)+1)+1)>>1)*(m+1)>>1)-k # Chai Wah Wu, Jul 14 2022

Formula

From Jon E. Schoenfield, Jun 23 2022: (Start)
a(n) = t(n) - s(n) where
s(n) = n*(n-1)/2,
j = floor(sqrt(8*n^2 - 8*n + 1)),
m = ceiling(j/2) - n + 1, and
t(n) = (m*(m + 2*n - 1))/2. (End)

A316296 a(n) = Sum_{k=1..n} f(k, n), where f(i, j) is the number of multiples of i greater than j and less than 2*j.

Original entry on oeis.org

0, 1, 3, 5, 9, 10, 15, 18, 21, 24, 31, 30, 38, 41, 44, 48, 55, 56, 64, 65, 70, 75, 84, 81, 90, 95, 98, 103, 112, 109, 120, 123, 129, 134, 139, 139, 150, 155, 160, 161, 173, 170, 183, 184, 187, 198, 205, 202, 212, 217, 223, 226, 239, 236, 245, 248, 255, 262, 271, 266, 282, 285, 288
Offset: 1

Author

Andrea La Rosa, Jun 29 2018

Keywords

Comments

f(n, m) is the number of multiples of n that are > m and < 2*m. n and m must be both >= 0.
By definition, this means that f(n, m) =
0 if n >= 2m;
1 if m < n < 2m;
If n <= m, then m = kn + q, where 0 <= q < n.
It can be proven that in this case f(n, m) =
k - 1 if q = 0;
k if q > 0 and (n - q) >= q;
k + 1 if q > 0 and (n - q) < q.
Let sd(n) = A006218; then a(n) = sd(2n-1) - sd(n) - (n - 1).
Also, a(n) = Sum_{k=n+1..2n-1} (d(k) - 1), where d(k) is number of divisors (A000005).
Number of ways the numbers from 1..n divide the numbers from n+1..2n-1, n>=2. - Wesley Ivan Hurt, Feb 08 2022

Examples

			For n = 7, a(7) = f(1,7) + f(2,7) + f(3,7) + f(4,7) + f(5,7) + f(6,7) + f(7,7) = 6 + 3 + 2 + 2 + 1 + 1 = 15.
		

Programs

  • JavaScript
    function f(n,m){
        var count = 0;
        for(var i=m+1; i<2*m; i++){
            if(i%n === 0) count++;
        }
        return count;
    }
    function sf(n){
        var sum = 0;
        for(var i=1; i<=n; i++){
            sum += f(i, n);
        }
        return sum;
    }
    
  • PARI
    a(n) = n + sum(m = 1, n, (floor((n<<1 - 1) / m) - ceil((n + 1) / m))) \\ David A. Corneth, Jun 29 2018
    
  • Python
    from math import isqrt
    def A316296(n): return ((s:=isqrt(n))+(t:=isqrt(m:=(n<<1)-1)))*(s-t)+(sum(m//k for k in range(1,t+1))-sum(n//k for k in range(1,s+1))<<1)-n+1 # Chai Wah Wu, Oct 24 2023

Formula

a(n) = Sum_{k=1..n} Sum_{i=n+1..2n-1} (1-ceiling(i/k)+floor(i/k)). - Wesley Ivan Hurt, Feb 08 2022