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

A007775 Numbers not divisible by 2, 3 or 5.

Original entry on oeis.org

1, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 77, 79, 83, 89, 91, 97, 101, 103, 107, 109, 113, 119, 121, 127, 131, 133, 137, 139, 143, 149, 151, 157, 161, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 203, 209
Offset: 1

Views

Author

Keywords

Comments

Also numbers n such that the sum of the 4th powers of the first n positive integers is divisible by n, or A000538(n) = n*(n+1)(2*n+1)(3*n^2+3*n-1)/30 is divisible by n. - Alexander Adamchuk, Jan 04 2007
Also the 7-rough numbers: positive integers that have no prime factors less than 7. - Michael B. Porter, Oct 09 2009
a(n) mod 3 has period 8, repeating [1,1,2,1,2,1,2,2] = (n mod 2) + floor(((n-1) mod 8)/7) - floor(((n-2) mod 8)/7) + 1. floor(a(n)/3) is the set of numbers k such that k is congruent to {0,2,3,4,5,6,7,9} mod 10 = floor((5*n-2)/4)-floor((n mod 8)/6). - Gary Detlefs, Jan 08 2012
Numbers k such that C(k+3,3)==1 (mod k) and C(k+5,5)==1 (mod k). - Gary Detlefs, Sep 15 2013
a(n) mod 30 has period 8 repeating [1, 7, 11, 13, 17, 19, 23, 29]. The mean of these 8 numbers is 120/8 = 15. (a(n)-15) mod 30 has period 8 repeating [-14, -8, -4, -2, 2, 4, 8, 14]. One half of the absolute value produces the symmetric sequence [7, 4, 2, 1, 1, 2, 4, 7] = A061501(((n-1) + 16) mod 8). - Gary Detlefs, Sep 24 2013
a(n) are exactly those positive integers m such that the sequence b(n) = n*(n + m)*(n + 2*m)*(n + 3*m)(n + 4*m)/120 is integral. Cf. A007310. - Peter Bala, Nov 13 2015
The asymptotic density of this sequence is 4/15. - Amiram Eldar, Sep 30 2020
If a(n) + a(n+1) = 0 (mod 30), then a(n-j) + a(n+j+1) = a(n) + a(n+1) for each j in [1, n-1]. - Alexandre Herrera, Jun 27 2023

Crossrefs

Cf. A000538, A054403, A145011 (first differences).
For k-rough numbers with other values of k, see A000027, A005408, A007310, A007775, A008364, A008365, A008366, A166061, A166063.
Complement is A080671.
For digital root of Fibonacci numbers indexed by this sequence, see A227896.

Programs

  • Haskell
    a007775 n = a007775_list !! (n-1)
    a007775_list = 1 : filter ((> 5) . a020639) [1..]
    -- Reinhard Zumkeller, Jan 06 2013
    
  • Magma
    I:=[1, 7, 11, 13, 17, 19, 23, 29, 31]; [n le 9 select I[n] else Self(n-1) +Self(n-8) - Self(n-9): n in [1..80]]; // G. C. Greubel, Oct 22 2018
    
  • Maple
    for i from 1 to 500 do if gcd(i,30) = 1 then print(i); fi; od;
    for k from 1 to 300 do if ((k^2 mod 48=1) or (k^2 mod 48=25)) and ((k^2 mod 120=1) or (k^2 mod 120=49)) then print(k) fi od. # Gary Detlefs, Dec 30 2011
  • Mathematica
    Select[ Range[ 300 ], GCD[ #1, 30 ]==1& ]
    Select[Range[250], Mod[#, 2]>0&&Mod[#, 3]>0&&Mod[#, 5]>0&] (* Vincenzo Librandi, Feb 08 2014 *)
    a[ n_] := Quotient[ n, 8, 1] 30 + {1, 7, 11, 13, 17, 19, 23, 29}[[Mod[n, 8, 1]]]; (* Michael Somos, Jun 02 2014 *)
    LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 7, 11, 13, 17, 19, 23, 29, 31}, 100] (* Mikk Heidemaa, Dec 07 2017 *)
    Cases[Range@1000, x_ /; NoneTrue[Array[Prime, 3], Divisible[x, #] &]] (* Mikk Heidemaa, Dec 07 2017 *)
    CoefficientList[ Series[(x^8 + 6x^7 + 4x^6 + 2x^5 + 4x^4 + 2x^3 + 4x^2 + 6x + 1)/((x - 1)^2 (x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1)), {x, 0, 55}], x] (* Robert G. Wilson v, Dec 07 2017 *)
  • PARI
    isA007775(n) = gcd(n,30)==1 \\ Michael B. Porter, Oct 09 2009
    
  • PARI
    {a(n) = n\8 * 30 + [ -1, 1, 7, 11, 13, 17, 19, 23][n%8 + 1]} /* Michael Somos, Feb 05 2011 */
    
  • PARI
    {a(n) = n\8 * 6 + 9 + 3 * (n+1)\2 * 2 - max(5, (n-2)%8) * 2} /* Michael Somos, Jun 02 2014 */
    
  • PARI
    Vec(x*(1+6*x+4*x^2+2*x^3+4*x^4+2*x^5+4*x^6+6*x^7+x^8)/((1+x)*(x^2+1)*(x^4+1)*( x-1)^2) + O(x^100)) \\ Altug Alkan, Nov 16 2015
    
  • Python
    def A007775(n): return ((m:=n-1)<<2|1)-(m>>2&-2)+(2,0,-2,0)[m-1>>1&3] # Chai Wah Wu, Feb 02 2025
  • Sage
    a = lambda n: ((((n-1)<< 2)-((n-1)>>2))|1) + ((((n-1)<<1)-((n-1)>> 1)) & 2)
    print([a(n) for n in (1..56)]) # after Andrew Lelechenko, Peter Luschny, Jul 08 2017
    

Formula

A141256(a(n)) = n+1. - Reinhard Zumkeller, Jun 17 2008
From R. J. Mathar, Feb 27 2009: (Start)
a(n+8) = a(n) + 30.
a(n) = a(n-1) + a(n-8) - a(n-9).
G.f.: x*(1 + 6*x + 4*x^2 + 2*x^3 + 4*x^4 + 2*x^5 + 4*x^6 + 6*x^7 + x^8)/((1 + x)*(x^2 + 1)*(x^4 + 1)*(x-1)^2). (End)
a(n) = 4*n - 3 - 2*floor((n-1)/8) + (1 + (-1)^floor((n-2)/2))*(-1)^floor((n-2)/4), n >= 1. - Timothy Hopper, Mar 14 2010
a(1 - n) = -a(n). - Michael Somos, Feb 05 2011
Numbers k such that ((k^2 mod 48=1) or (k^2 mod 48=25)) and ((k^2 mod 120=1) or (k^2 mod 120=49)). - Gary Detlefs, Dec 30 2011
Numbers k such that k^2 mod 30 is 1 or 19. - Gary Detlefs, Dec 31 2011
a(n) = 3*(floor((5*n-2)/4) - floor((n mod 8)/6)) + (n mod 2) + floor(((n-1) mod 8)/7) - floor(((n-2) mod 8)/7) + 1. - Gary Detlefs, Jan 08 2012
a(n) = 4*n - 3 + 2*(floor((n+6)/8) - floor((n+4)/8) - floor((n+2)/8) + floor(n/8) - floor((n-1)/8)), n >= 1. From the o.g.f. given above by R. J. Mathar (with the denominator written as (1-x^8)*(1-x)), and a two-step reduction of the floor functions. Compare with Hopper's and Detlefs's formulas above. - Wolfdieter Lang, Jan 26 2012
a(n) = (6*f(n) - 3 + (-1)^f(n))/2, where f(n)= n + floor(n/4)+ floor(((n+4) mod 8)/6). - Gary Detlefs, Sep 15 2013
a(n) = 30*floor((n-1)/8) + 15 + 2*f((n-1) mod 8 + 16)*(-1)^floor(((n+3) mod 8)/4), where f(n) = (n*(n+1)/2+1) mod 10. - Gary Detlefs, Sep 24 2013
a(n) = 3*n + 6*floor(n/8) + (n mod 2) - 2*floor(((n-2) mod 8)/6) - 2*floor(((n-2) mod 8)/7) + 1. - Gary Detlefs, Jun 01 2014
a(n+1) = ((n << 2 - n >> 2) || 1) + ((n << 1 - n >> 1) && 2), where << and >> are bitwise left and right shifts, || and && are bitwise "or" and "and". - Andrew Lelechenko, Jul 08 2017
a(n) = 2*n + 2*floor(1/2 + (7*n)/8) + 2*(91 mod (2 - ((3*n)/4 + n^2/4) mod 2)) - 3 (n > 0). - Mikk Heidemaa, Dec 06 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(23 + sqrt(5) - sqrt(6*(5 + sqrt(5))))*Pi/15. - Amiram Eldar, Dec 13 2021

A236185 Differences between terms of compacting Eratosthenes sieve for prime(4) = 7.

Original entry on oeis.org

4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2
Offset: 1

Views

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a ordinal x.
This pattern, dp(x) is a sequence of the differences between consecutive prime numbers as described by p(x).
For P(4), dp(4)is the relative offsets of the next 7 primes: 7, +4 = 11, +2 = 13, +4 = 17, +2 = 19, +4 = 23, +6 = 29, +2 = 31
The Eratosthenes sieve can be expressed as follows. Start with S1 = [2, 3, 4, 5, ...] the list of numbers bigger than 1. Removing all multiples of the first element 2 yields the list S2 = [3, 5, 7, 9, ...]. Removing all multiples of the first element 3 yields S3 = [5, 7, 11, 13, 17, 19, ...], Removing all multiples of the first element 5 yields S4 = [7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, ...], and so on. The list of first differences of S4 is [4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, ...] which is this sequence. - Michael Somos, Mar 12 2014

Crossrefs

Cf. A007775. Essentially the same as A145011.

Programs

  • PARI
    {a(n) = my(A); if( n<1, 0, A = vector( n*28 + 48, k, k+1); for( i = 1, 3, A = select( k -> k%prime(i), A) ); polcoeff( (1 - x) * Ser( select( k -> k>7 && (k%7) == 0, A) / 7), n)) }; /* Michael Somos, Mar 10 2014 */
    (C#)
    // dp(4) = GeneratePrimeDifferencialPattern( 4 );
    static void GeneratePrimeDifferencialPattern( int ordinal )
    {
        // Contract
        if( ordinal < 1 )
            throw new ArgumentOutOfRangeException( "ordinal" );
        // Local data
        int size = 1 << 18;
        int[] numberLine = Enumerable.Range( 2, size ).ToArray();
        int pointer = 0;
        // Apply sieve: for each integer greater than 1
        while( pointer < numberLine.Length )
        {
            // Locals
            int x = numberLine[pointer];
            int index = pointer;
            List pattern = new List();
            int skips = 0;
            int count = 0;
            bool counting = true;
            // Find all products
            for( int n = x + x; n < size; n += x )
            {
                // Fast forward through number-line
                while( numberLine[++index] < n )
                    skips++;
                // If the number was not already removed
                if( numberLine[index] == n )
                {
                    // Add skip count to pattern
                    pattern.Add( numberLine[index] );
                    // Mark as not prime
                    numberLine[index] = 0;
                    // Reset skips
                    if( counting )
                    {
                        count++;
                        if( skips <= 2 )
                            counting = false;
                    }
                    skips = 0;
                }
                // Otherwise we've skipped again
                else skips++;
            }
            // Reduce number-line
            numberLine = numberLine.Where( n => n > 0 ).ToArray();
            // If we have a pattern we want
            if( pattern.Any() && pointer == ordinal - 1 )
            {
                // Report pattern
                int prime = numberLine[ordinal-1];
                var d = pattern.Take( count ).ToArray();
                List dp = new List();
                for( int y = 1; y < count; y++ )
                    dp.Add( ( d[y] - d[y - 1] ) / prime );
                System.Console.WriteLine( "Pattern P({0}) = {1} :: dp({0}) = {2}", pointer + 1, numberLine[pointer], String.Join( ", ", dp ) );
                return;
            }
            // Move number-line pointer forward
            pointer++;
        }
    }

Formula

a(n + 8) = a(n). - Michael Somos, Mar 10 2014
a(n) = 4*((n+2) mod 2) + 2*((n+1) mod 2) + 4*(f(8,n+2)+f(8,n)) - 2*f(8,n+1), where f(x,n)= floor(n/x)-floor((n-1)/x). - Gary Detlefs, Nov 16 2020

Extensions

Edited by Michael Somos, Mar 12 2014. (Added code and comments, refined description.)

A257251 Square array A(row,col) = A083221(row,col+1) - A083221(row,col): the first differences of each row of array constructed from the sieve of Eratosthenes.

Original entry on oeis.org

2, 2, 6, 2, 6, 20, 2, 6, 10, 42, 2, 6, 20, 28, 110, 2, 6, 10, 14, 22, 156, 2, 6, 20, 28, 44, 52, 272, 2, 6, 10, 14, 22, 26, 34, 342, 2, 6, 20, 28, 44, 52, 68, 76, 506, 2, 6, 10, 42, 66, 78, 102, 114, 138, 812, 2, 6, 20, 14, 22, 26, 34, 38, 46, 58, 930, 2, 6, 10, 42, 66, 78, 102, 114, 138, 174, 186, 1332
Offset: 1

Views

Author

Antti Karttunen, Apr 19 2015

Keywords

Comments

The array is read by downwards antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Examples

			The top left corner of the array:
     2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2
     6,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6
    20,  10,  20,  10,  20,  10,  20,  10,  20,  10,  20,  10,  20,  10,  20
    42,  28,  14,  28,  14,  28,  42,  14,  42,  28,  14,  28,  14,  28,  42
   110,  22,  44,  22,  44,  66,  22,  66,  44,  22,  44,  66,  66,  22,  66
   156,  52,  26,  52,  78,  26,  78,  52,  26,  52,  78,  78,  26,  78,  52
   272,  34,  68, 102,  34, 102,  68,  34,  68, 102, 102,  34, 102,  68,  34
   342,  76, 114,  38, 114,  76,  38,  76, 114, 114,  38, 114,  76,  38, 114
   506, 138,  46, 138,  92,  46,  92, 138, 138,  46, 138,  92,  46, 138,  92
   812,  58, 174, 116,  58, 116, 174, 174,  58, 174, 116,  58, 174, 116, 174
   930, 186, 124,  62, 124, 186, 186,  62, 186, 124,  62, 186, 124, 186, 248
  1332, 148,  74, 148, 222, 222,  74, 222, 148,  74, 222, 148, 222, 296, 148
  1640,  82, 164, 246, 246,  82, 246, 164,  82, 246, 164, 246, 328, 164,  82
  1806, 172, 258, 258,  86, 258, 172,  86, 258, 172, 258, 344, 172,  86, 172
  2162, 282, 282,  94, 282, 188,  94, 282, 188, 282, 376, 188,  94, 188,  94
  2756, 318, 106, 318, 212, 106, 318, 212, 318, 424, 212, 106, 212, 106, 212
  ...
		

Crossrefs

Transpose: A257252.
Column 1: A036689.
Row 4: 7 * A145011.
Cf. A083221, A257253 (same array but with terms divided by 2).
Cf. arrays A257255 and A257257, also A257513.

Programs

Formula

A(row,col) = A083221(row,col+1) - A083221(row,col).
A(row,col) = 2*A257253(row,col).

A257253 Square array A(row,col) = (1/2) * (A083221(row,col+1) - A083221(row,col)): half of the first differences of each row of array constructed from the sieve of Eratosthenes.

Original entry on oeis.org

1, 1, 3, 1, 3, 10, 1, 3, 5, 21, 1, 3, 10, 14, 55, 1, 3, 5, 7, 11, 78, 1, 3, 10, 14, 22, 26, 136, 1, 3, 5, 7, 11, 13, 17, 171, 1, 3, 10, 14, 22, 26, 34, 38, 253, 1, 3, 5, 21, 33, 39, 51, 57, 69, 406, 1, 3, 10, 7, 11, 13, 17, 19, 23, 29, 465
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

The array A(row,col) is read by its downwards antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Examples

			The top left corner of the array:
     1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1
     3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3
    10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10
    21,  14,   7,  14,   7,  14,  21,   7,  21,  14,   7,  14,   7,  14,  21
    55,  11,  22,  11,  22,  33,  11,  33,  22,  11,  22,  33,  33,  11,  33
    78,  26,  13,  26,  39,  13,  39,  26,  13,  26,  39,  39,  13,  39,  26
   136,  17,  34,  51,  17,  51,  34,  17,  34,  51,  51,  17,  51,  34,  17
   171,  38,  57,  19,  57,  38,  19,  38,  57,  57,  19,  57,  38,  19,  57
   253,  69,  23,  69,  46,  23,  46,  69,  69,  23,  69,  46,  23,  69,  46
   406,  29,  87,  58,  29,  58,  87,  87,  29,  87,  58,  29,  87,  58,  87
   465,  93,  62,  31,  62,  93,  93,  31,  93,  62,  31,  93,  62,  93, 124
   666,  74,  37,  74, 111, 111,  37, 111,  74,  37, 111,  74, 111, 148,  74
   820,  41,  82, 123, 123,  41, 123,  82,  41, 123,  82, 123, 164,  82,  41
   903,  86, 129, 129,  43, 129,  86,  43, 129,  86, 129, 172,  86,  43,  86
  1081, 141, 141,  47, 141,  94,  47, 141,  94, 141, 188,  94,  47,  94,  47
  1378, 159,  53, 159, 106,  53, 159, 106, 159, 212, 106,  53, 106,  53, 106
  ...
		

Crossrefs

Transpose: A257254.
Cf. A083221, A257251 (same array but with terms multiplied by 2).
Column 1: A008837.
Row 4: (7/2) * A145011.

Programs

Formula

A(row,col) = (1/2) * (A083221(row,col+1) - A083221(row,col)).
A(row,col) = A257251(row,col)/2.
Showing 1-4 of 4 results.