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

A256252 Number of successive odd noncomposite numbers A006005 and number of successive odd composite numbers A071904, interleaved.

Original entry on oeis.org

4, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 2, 1, 1, 6, 1, 1, 1, 2, 2, 4, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 2, 1, 2, 5, 1, 5, 1, 1, 2, 1, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 4, 1, 6, 1, 1, 2, 1, 1, 6, 1, 2, 1, 4, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2
Offset: 1

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

See also A256253 and A256262 which contain similar diagrams.

Examples

			Consider an irregular array in which the odd-indexed rows list successive odd noncomposite numbers (A006005) and the even-indexed rows list successive odd composite numbers (A071904), in the sequence of odd numbers (A005408), as shown below:
1, 3, 5, 7;
9;
11, 13;
15;
17; 19;
21,
23;
25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd noncomposite numbers A006005 and odd composite numbers A071904:
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   31
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   29
.           | | |_ _ _ _ _ _ _ _ _ _ _  | | |   23
.           | | | |_ _ _ _ _ _ _ _ _  | | | |   19
.           | | | |_ _ _ _ _ _ _ _  | | | | |   17
.           | | | | |_ _ _ _ _ _  | | | | | |   13
.           | | | | |_ _ _ _ _  | | | | | | |   11
.           | | | | | |_ _ _  | | | | | | | |    7
.           | | | | | |_ _  | | | | | | | | |    5
.           | | | | | |_  | | | | | | | | | |    3
.   A071904 | | | | | |_|_|_|_| | | | | | | |    1
.      9    | | | | |_ _ _ _ _|_|_| | | | | | A006005
.     15    | | | |_ _ _ _ _ _ _ _|_|_| | | |
.     21    | | |_ _ _ _ _ _ _ _ _ _ _|_| | |
.     25    | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
.     27    |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..9:
.                      _ _ _ _
.                             |_ _
.                                 |_ _
.                                     |_
.                                       |
.                                       |_ _
.
The sequence begins:      4,1,2,1,2,1,1,2,2,...
.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(nb = 1, isc = 0); forstep (n=3, nn, 2, if (bitxor(isc, isprime(n)), nb++, print1(nb, ", "); nb = 1; isc = ! isc););} \\ Michel Marcus, May 25 2015

Formula

a(n) = A256253(n+1), n >= 2.

A161993 A006005 (shifted) convolved with all of its regularly "aerated" variants.

Original entry on oeis.org

1, 3, 8, 19, 43, 85, 171, 315, 580, 1022, 1766, 2982, 4959, 8081, 12997, 20596, 32261, 49909, 76447, 115872, 174133, 259312, 383206, 561877, 818225, 1183266, 1700658, 2429266, 3450562, 4874167, 6850072, 9578548, 13331445, 18469783, 25478494, 34999375, 47887091
Offset: 0

Views

Author

Gary W. Adamson, Jun 24 2009

Keywords

Comments

Refer to A161779 for the analogous sequence based on the factorials.
Given A006005 (1 together with the odd primes = odd noncomposite numbers) = a, then b = the aerated variant: (1, 0, 3, 0, 5, 0, 7,...); c = (1, 0, 0, 3, 0, 0, 5,...) and so on such that A161993 = the infinite convolution product: a*b*c*...

Crossrefs

Programs

  • Maple
    p:= n-> `if`(n=0, 1, ithprime(n+1)):
    b:= proc(n, i) option remember; `if`(i>n, 0,
         `if`(irem(n, i, 'r')=0, p(r), 0)+
          add(p(j)*b(n-i*j, i+1), j=0..n/i))
        end:
    a:= n-> `if`(n=0, 1, b(n, 1)):
    seq(a(n), n=0..45);  # Alois P. Heinz, Jul 27 2019
  • Mathematica
    p[n_] := If[n==0, 1, Prime[n+1]];
    b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i]==0, p[n/i], 0] + Sum[p[j] b[n - i j, i+1], {j, 0, n/i}]];
    a[n_] := If[n==0, 1, b[n, 1]];
    a /@ Range[0, 45] (* Jean-François Alcover, Nov 20 2020, after Alois P. Heinz *)

Extensions

Definition and comment corrected by Omar E. Pol, Aug 18 2011
Correct offset and a(13)-a(36) from Alois P. Heinz, Jul 27 2019

A348835 Triangle, read by rows, T(n, k) is the smallest term of A006005 strictly larger than abs(A006005(n) - A006005(k)).

Original entry on oeis.org

1, 3, 1, 5, 3, 1, 7, 5, 3, 1, 11, 11, 7, 5, 1, 13, 11, 11, 7, 3, 1, 17, 17, 13, 11, 7, 5, 1, 19, 17, 17, 13, 11, 7, 3, 1, 23, 23, 19, 17, 13, 11, 7, 5, 1, 29, 29, 29, 23, 19, 17, 13, 11, 7, 1, 31, 29, 29, 29, 23, 19, 17, 13, 11, 3, 1, 37, 37, 37, 31, 29, 29, 23, 19, 17, 11, 7, 1
Offset: 1

Views

Author

Michel Marcus, Nov 01 2021

Keywords

Examples

			Triangle begins:
   1;
   3,  1;
   5,  3,  1;
   7,  5,  3,  1;
  11, 11,  7,  5, 1;
  13, 11, 11,  7, 3, 1;
  17, 17, 13, 11, 7, 5, 1;
  ...
		

Crossrefs

Cf. A006005 (1 and the odd primes).

Programs

  • PARI
    f(n) = prime(n)-(n==1); /* A006005 */
    T(n, k) = {my(j=1, m = abs(f(n)-f(k))); while (f(j) < m, j++); f(j);}

Formula

T(n, n) = 1.
T(n, 1) = n.

A006093 a(n) = prime(n) - 1.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, 96, 100, 102, 106, 108, 112, 126, 130, 136, 138, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238, 240, 250, 256, 262, 268, 270
Offset: 1

Views

Author

Keywords

Comments

These are also the numbers that cannot be written as i*j + i + j (i,j >= 1). - Rainer Rosenthal, Jun 24 2001; Henry Bottomley, Jul 06 2002
The values of k for which Sum_{j=0..n} (-1)^j*binomial(k, j)*binomial(k-1-j, n-j)/(j+1) produces an integer for all n such that n < k. Setting k=10 yields [0, 1, 4, 11, 19, 23, 19, 11, 4, 1, 0] for n = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], so 10 is in the sequence. Setting k=3 yields [0, 1, 1/2, 1/2] for n = [-1, 0, 1, 2], so 3 is not in the sequence. - Dug Eichelberger (dug(AT)mit.edu), May 14 2001
n such that x^n + x^(n-1) + x^(n-2) + ... + x + 1 is irreducible. - Robert G. Wilson v, Jun 22 2002
Records for Euler totient function phi.
Together with 0, n such that (n+1) divides (n!+1). - Benoit Cloitre, Aug 20 2002; corrected by Charles R Greathouse IV, Apr 20 2010
n such that phi(n^2) = phi(n^2 + n). - Jon Perry, Feb 19 2004
Numbers having only the trivial perfect partition consisting of a(n) 1's. - Lekraj Beedassy, Jul 23 2006
Numbers n such that the sequence {binomial coefficient C(k,n), k >= n } contains exactly one prime. - Artur Jasinski, Dec 02 2007
Record values of A143201: a(n) = A143201(A001747(n+1)) for n > 1. - Reinhard Zumkeller, Aug 12 2008
From Reinhard Zumkeller, Jul 10 2009: (Start)
The first N terms can be generated by the following sieving process:
start with {1, 2, 3, 4, ..., N - 1, N};
for i := 1 until SQRT(N) do
(if (i is not striked out) then
(for j := 2 * i + 1 step i + 1 until N do
(strike j from the list)));
remaining numbers = {a(n): a(n) <= N}. (End)
a(n) = partial sums of A075526(n-1) = Sum_{1..n} A075526(n-1) = Sum_{1..n} (A008578(n+1) - A008578(n)) = Sum_{1..n} (A158611(n+2) - A158611(n+1)) for n >= 1. - Jaroslav Krizek, Aug 04 2009
A171400(a(n)) = 1 for n <> 2: subsequence of A171401, except for a(2) = 2. - Reinhard Zumkeller, Dec 08 2009
Numerator of (1 - 1/prime(n)). - Juri-Stepan Gerasimov, Jun 05 2010
Numbers n such that A002322(n+1) = n. This statement is stronger than repeating the property of the entries in A002322, because it also says in reciprocity that this sequence here contains no numbers beyond the Carmichael numbers with that property. - Michel Lagneau, Dec 12 2010
a(n) = A192134(A095874(A000040(n))); subsequence of A192133. - Reinhard Zumkeller, Jun 26 2011
prime(a(n)) + prime(k) < prime(a(k) + k) for at least one k <= a(n): A212210(a(n),k) < 0. - Reinhard Zumkeller, May 05 2012
Except for the first term, numbers n such that the sum of first n natural numbers does not divide the product of first n natural numbers; that is, n*(n + 1)/2 does not divide n!. - Jayanta Basu, Apr 24 2013
BigOmega(a(n)) equals BigOmega(a(n)*(a(n) + 1)/2), where BigOmega = A001222. Rationale: BigOmega of the product on the right hand side factorizes as BigOmega(a/2) + Bigomega(a+1) = BigOmega(a/2) + 1 because a/2 and a + 1 are coprime, because BigOmega is additive, and because a + 1 is prime. Furthermore Bigomega(a/2) = Bigomega(a) - 1 because essentially all 'a' are even. - Irina Gerasimova, Jun 06 2013
Record values of A060681. - Omar E. Pol, Oct 26 2013
Deficiency of n-th prime. - Omar E. Pol, Jan 30 2014
Conjecture: All the sums Sum_{k=s..t} 1/a(k) with 1 <= s <= t are pairwise distinct. In general, for any integers d >= -1 and m > 0, if Sum_{k=i..j} 1/(prime(k)+d)^m = Sum_{k=s..t} 1/(prime(k)+d)^m with 0 < i <= j and 0 < s <= t then we must have (i,j) = (s,t), unless d = m = 1 and {(i,j),(s,t)} = {(4,4),(8,10)} or {(4,7),(5,10)}. (Note that 1/(prime(8)+1)+1/(prime(9)+1)+1/(prime(10)+1) = 1/(prime(4)+1) and Sum_{k=5..10} 1/(prime(k)+1) = 1/(prime(4)+1) + Sum_{k=5..7} 1/(prime(k)+1).) - Zhi-Wei Sun, Sep 09 2015
Numbers n such that (prime(i)^n + n) is divisible by (n+1), for all i >= 1, except when prime(i) = n+1. - Richard R. Forberg, Aug 11 2016
a(n) is the period of Fubini numbers (A000670) over the n-th prime. - Federico Provvedi, Nov 28 2020

References

  • Archimedeans Problems Drive, Eureka, 40 (1979), 28.
  • Harvey Dubner, Generalized Fermat primes, J. Recreational Math., 18 (1985): 279-280.
  • M. Gardner, The Colossal Book of Mathematics, pp. 31, W. W. Norton & Co., NY, 2001.
  • M. Gardner, Mathematical Circus, pp. 251-2, Alfred A. Knopf, NY, 1979.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = K(n, 1) and A034693(K(n, 1)) = 1 for all n. The subscript n refers to this sequence and K(n, 1) is the index in A034693. - Labos Elemer
Cf. A000040, A034694. Different from A075728.
Complement of A072668 (composite numbers minus 1), A072670(a(n))=0.
Essentially the same as A039915.
Cf. A101301 (partial sums), A005867 (partial products).
Column 1 of the following arrays/triangles: A087738, A249741, A352707, A378979, A379010.
The last diagonal of A162619, and of A174996, the first diagonal in A131424.
Row lengths of irregular triangles A086145, A124223, A212157.

Programs

Formula

a(n) = (p-1)! mod p where p is the n-th prime, by Wilson's theorem. - Jonathan Sondow, Jul 13 2010
a(n) = A000010(prime(n)) = A000010(A006005(n)). - Antti Karttunen, Dec 16 2012
a(n) = A005867(n+1)/A005867(n). - Eric Desbiaux, May 07 2013
a(n) = A000040(n) - 1. - Omar E. Pol, Oct 26 2013
a(n) = A033879(A000040(n)). - Omar E. Pol, Jan 30 2014

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010
Obfuscating comments removed by Joerg Arndt, Mar 11 2010
Edited by Charles R Greathouse IV, Apr 20 2010

A005097 (Odd primes - 1)/2.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, 135, 138, 140, 141, 146, 153, 155, 156
Offset: 1

Views

Author

Keywords

Comments

Or, numbers k such that 2k+1 is prime.
Also numbers not of the form 2xy + x + y. - Jose Brox (tautocrona(AT)terra.es), Dec 29 2005
This sequence arises if you factor the product of a large number of the first odd numbers into the form 3^n(3)5^n(5)7^n(7)11^n(11)... Then n(3)/n(5) = 2, n(3)/n(7) = 3, n(3)/n(11) = 5, ... . - Andrzej Staruszkiewicz (astar(AT)th.if.uj.edu.pl), May 31 2007
Kohen shows: A king invites n couples to sit around a round table with 2n+1 seats. For each couple, the king decides a prescribed distance d between 1 and n which the two spouses have to be seated from each other (distance d means that they are separated by exactly d-1 chairs). We will show that there is a solution for every choice of the distances if and only if 2n+1 is a prime number [i.e., iff n is in A005097], using a theorem known as Combinatorial Nullstellensatz. - Jonathan Vos Post, Jun 14 2010
Starting from 6, positions at which new primes are seen for Goldbach partitions. E.g., 31 is first seen at 34 from 31+3, so position = 1 + (34-6)/2 = 15. - Bill McEachen, Jul 05 2010
Perfect error-correcting Lee codes of word length n over Z: it is conjectured that these always exist when 2n+1 is a prime, as mentioned in Horak. - Jonathan Vos Post, Sep 19 2011
Also solutions to: A000010(2*n+1) = n * A000005(2*n+1). - Enrique Pérez Herrero, Jun 07 2012
A193773(a(n)) = 1. - Reinhard Zumkeller, Jan 02 2013
I conjecture that the set of pairwise sums of terms of this sequence (A005097) is the set of integers greater than 1, i.e.: 1+1=2, 1+2=3, ..., 5+5=10, ... (This is equivalent to Goldbach's conjecture: every even integer greater than or equal to 6 can be expressed as the sum of two odd primes.) - Lear Young, May 20 2014
See conjecture and comments from Richard R. Forberg, in Links section below, on the relationship of this sequence to rules on values of c that allow both p^q+c and p^q-c to be prime, for an infinite number of primes p. - Richard R. Forberg, Jul 13 2016
The sequence represents the minimum number Ng of gears which are needed to draw a complete graph of order p using a Spirograph(R), where p is an odd prime. The resulting graph consists of Ng hypotrochoids whose respective nodes coincide. If the teethed ring has a circumference p then Ng = (p-1)/2. Examples: A complete graph of order three can be drawn with a Spirograph(R) using a ring with 3n teeth and one gear with n teeth. n is an arbitrary number, only related to the geometry of the gears. A complete graph of order 5 can be drawn using a ring with diameter 5 and 2 gears with diameters 1 and 2 respectively. A complete graph of order 7 can be drawn using a ring with diameter 7 and 3 gears with diameters 1, 2 and 3 respectively. - Bob Andriesse, Mar 31 2017

Crossrefs

Complement of A047845. Cf. A000040, A006005, A006093.
A130290 is an essentially identical sequence.
Cf. A005384 (subsequence of primes), A266400 (their indices in this sequence).
Numbers n such that 2n+k is prime: this seq(k=1), A067076 (k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19).
Numbers n such that 2n-k is prime: A006254 (k=1), A098090 (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), A097363 (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).
Cf. also A266409, A294507.

Programs

Formula

a(n) = A006093(n)/2 = A000010(A000040(n+1))/2.
a(n) = (prime(n+1)^2-1)/(2*sigma(prime(n+1))) = (A000040(n+1)^2-1)/(2*A000203(A000040(n+1))). - Gary Detlefs, May 02 2012
a(n) = (A065091(n) - 1) / 2. - Reinhard Zumkeller, Jan 02 2013
a(n) ~ n*log(n)/2. - Ilya Gutkovskiy, Jul 11 2016
a(n) = A294507(n) (mod prime(n+1)). - Jonathan Sondow, Nov 04 2017
a(n) = A130290(n+1). - Chai Wah Wu, Jun 04 2022

A174090 Powers of 2 and odd primes; alternatively, numbers that cannot be written as a sum of at least three consecutive positive integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 23, 29, 31, 32, 37, 41, 43, 47, 53, 59, 61, 64, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 256
Offset: 1

Views

Author

Vladimir Joseph Stephan Orlovsky, Mar 07 2010, and Omar E. Pol, Feb 24 2014

Keywords

Comments

From Omar E. Pol, Feb 24 2014: (Start)
Also the odd noncomposite numbers (A006005) and the powers of 2 with positive exponent, in increasing order.
If a(n) is composite and a(n) - a(n-1) = 1 then a(n-1) is a Mersenne prime (A000668), hence a(n-1)*a(n)/2 is a perfect number (A000396) and a(n-1)*a(n) equals the sum of divisors of a(n-1)*a(n)/2.
If a(n) is even and a(n+1) - a(n) = 1 then a(n+1) is a Fermat prime (A019434). (End)

Crossrefs

Numbers not in A111774.
Equals A000079 UNION A065091.
Equals A067133 \ {6}.

Programs

  • Maple
    N:= 300: # to get all terms <= N
    S:= {seq(2^i,i=0..ilog2(N))} union select(isprime,{ 2*i+1 $ i=1..floor((N-1)/2) }):
    sort(convert(S,list)); # Robert Israel, Jun 18 2015
  • Mathematica
    a[n_] := Product[GCD[2 i - 1, n], {i, 1, (n - 1)/2}] - 1;
    Select[Range[242], a[#] == 0 &] (* Gerry Martens, Jun 15 2015 *)
  • PARI
    list(lim)=Set(concat(concat(1,primes(lim)), vector(logint(lim\2,2),i,2^(i+1)))) \\ Charles R Greathouse IV, Sep 19 2024
    
  • PARI
    select( {is_A174090(n)=isprime(n)||n==1<M. F. Hasler, Oct 24 2024
  • Python
    from sympy import primepi
    def A174090(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x+(0 if x<=1 else 1-primepi(x))-x.bit_length())
        return bisection(f,n,n) # Chai Wah Wu, Sep 19 2024
    

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Sep 19 2024

Extensions

This entry is the result of merging an old incorrect entry and a more recent correct version. N. J. A. Sloane, Dec 07 2015

A065090 Natural numbers which are not odd primes: composites plus 1 and 2.

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94
Offset: 1

Views

Author

Labos Elemer, Nov 12 2001

Keywords

Crossrefs

Complement of A065091.

Programs

  • Haskell
    import Data.List (elemIndices)
    a065090 n = a065090_list !! (n-1)
    a065090_list = map (+ 1) $ elemIndices 0 a151763_list
    -- Reinhard Zumkeller, Oct 06 2011
    
  • Mathematica
    Join[{1, 2}, Select[Range[4, 100], CompositeQ]] (* Paolo Xausa, Aug 29 2025 *)
  • PARI
    { n=0; for (m=1, 10^9, if (!isprime(m) || m==2, write("b065090.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 06 2009
    
  • Python
    from sympy import composite
    def A065090(n): return composite(n-2) if n>2 else n # Chai Wah Wu, Jul 13 2024

Formula

A151763(a(n)) = 0.

A187203 The bottom entry in the absolute difference triangle of the divisors of n.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 4, 0, 10, 1, 12, 2, 8, 1, 16, 4, 18, 1, 8, 6, 22, 2, 16, 8, 8, 3, 28, 4, 30, 1, 8, 12, 24, 1, 36, 14, 8, 0, 40, 4, 42, 3, 20, 18, 46, 1, 36, 0, 8, 3, 52, 8, 36, 0, 8, 24, 58, 3, 60, 26, 4, 1, 40, 12, 66, 3, 8, 2, 70, 4, 72, 32, 32, 3
Offset: 1

Views

Author

Omar E. Pol, Aug 01 2011

Keywords

Comments

Note that if n is prime then a(n) = n - 1.
Where records occurs gives the odd noncomposite numbers (A006005).
First differs from A187202 at a(14).
It is important to note that at each step in the process, the absolute differences are taken, and not just at the end. This sequence is therefore not abs(A187202) as I mistakenly assumed at first. - Alonso del Arte, Aug 01 2011

Examples

			a(18) = 4 because the divisors of 18 are 1, 2, 3, 6, 9, 18, and the absolute difference triangle of the divisors is:
  1 . 2 . 3 . 6 . 9 . 18
  . 1 . 1 . 3 . 3 . 9
  . . 0 . 2 . 0 . 6
  . . . 2 . 2 . 6
  . . . . 0 . 4
  . . . . . 4
with bottom entry a(18) = 4.
Note that A187202(18) = 12.
		

Crossrefs

Programs

  • Haskell
    a187203 = head . head . dropWhile ((> 1) . length) . iterate diff . divs
       where divs n = filter ((== 0) . mod n) [1..n]
             diff xs = map abs $ zipWith (-) (tail xs) xs
    -- Reinhard Zumkeller, Aug 02 2011
  • Mathematica
    Table[d = Divisors[n]; While[Length[d] > 1, d = Abs[Differences[d]]]; d[[1]], {n, 100}] (* T. D. Noe, Aug 01 2011 *)
    Table[Nest[Abs[Differences[#]]&,Divisors[n],DivisorSigma[0,n]-1],{n,100}]//Flatten (* Harvey P. Dale, Nov 07 2022 *)
  • PARI
    A187203(n)={ for(i=2,#n=divisors(n), n=abs(vecextract(n,"^1")-vecextract(n,"^-1"))); n[1]}  \\ M. F. Hasler, Aug 01 2011
    

Extensions

Edited by Omar E. Pol, May 14 2016

A175524 A000120-deficient numbers.

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, 121, 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
Offset: 1

Views

Author

Vladimir Shevelev, Dec 03 2010

Keywords

Comments

For a more precise definition, see comment in A175522.
All odd primes (A065091) are in the sequence. Squares of the form (2^n+3)^2, n>=3, where 2^n+3 is prime (A057733), are also in the sequence. [Proof: (2^n+3)^2 = 2^(2*n)+2^(n+2)+2^(n+1)+2^3+1. Thus, since n>=3, A000120((2^n+3)^2)=5. Also, for primes of the form 2^n+3, (2^n+3)^2 has only two proper divisors, 1 and 2^n+3, so A000120(1)+A000120(2^n+3) = 4, and in conclusion, (2^n+3)^2 is deficient. QED]
It is natural to assume that there are infinitely many primes of the form 2^n+3 (by analogy with the Mersenne sequence 2^n-1). If this is true, the sequence contains infinitely many composite numbers, because it contains all of the form (2^n+3)^2.
a(n) = A006005(n) for n <= 30;

Crossrefs

Cf. A175522 (perfect version), A175526 (abundant version), A000120, A005100, A005101, A006005, A192895.

Programs

  • Haskell
    import Data.List (findIndices)
    a175524 n = a175524_list !! (n-1)
    a175524_list = map (+ 1) $ findIndices (< 0) a192895_list
    -- Reinhard Zumkeller, Jul 12 2011
    
  • Mathematica
    Select[Range[270], DivisorSum[#, DigitCount[#, 2, 1] &] < 2*DigitCount[#, 2, 1] &] (* Amiram Eldar, Jul 25 2023 *)
  • PARI
    is(n)=sumdiv(n,d,hammingweight(d))<2*hammingweight(n) \\ Charles R Greathouse IV, Jan 28 2016
  • Sage
    is_A175524 = lambda x: sum(A000120(d) for d in divisors(x)) < 2*A000120(x)
    A175524 = filter(is_A175524, IntegerRange(1, 10**4)) # D. S. McNeil, Dec 04 2010
    

Formula

A192895(a(n)) < 0. - Reinhard Zumkeller, Jul 12 2011

Extensions

More terms from Amiram Eldar, Feb 18 2019

A065475 Natural numbers excluding 2.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Nov 16 2001

Keywords

Comments

From the following 4 disjoint subsets of natural numbers A = {1}, B = {2}, OP = {odd primes}, C = {composites}, 16 sets are derivable: A000027 versus empty set, A002808 vs A008578, A065091 vs A065090, A000040 vs A018252, A006005 vs {{2} with A002808}, {1} vs {A000027 excluding 1}, {2} versus this sequence, {1, 2} versus Union[OP, C].
a(n) is the sum of the obvious divisors of n, which are 1 and n.
The natural numbers excluding 2 are the order numbers of magic squares. Order 2 magic squares do not exist. - William Walkington, Mar 12 2016
The numbers occurring at least twice in Pascal's triangle (A007318, A003016). - Rick L. Shepherd, Jun 05 2016
From Enrique Navarrete, Mar 03 2025: (Start)
a(n) is the number of binary strings of length n with at most one 0 and at least one 1. For example, the a(1)=1 string is 1 and the a(2)=3 strings are 01, 10, 11.
a(n) is also the number of ordered set partitions of an n-set into 2 sets such that the first set has at most one element and the second set has at least one element. (End)

Crossrefs

Programs

  • Magma
    &cat[[1],[n : n in [3..100]]]; // Wesley Ivan Hurt, Mar 13 2016
  • Maple
    printlevel := -1; a := [1]; T := x->LambertW(-x); f := series(((1+T(x)))/(1-T(x)), x, 77); for m from 3 to 77 do a := [op(a), op(2*m, f)] od; print(a); # Zerinvary Lajos, Mar 28 2009
  • Mathematica
    Join[{1}, Range[3, 100]] (* Wesley Ivan Hurt, Mar 13 2016 *)
    Drop[Range[100],{2}] (* Harvey P. Dale, Aug 11 2024 *)
  • PARI
    a(n)=n+(n>1) \\ Charles R Greathouse IV, Sep 01 2015
    
  • PARI
    x='x+O('x^99); Vec((1+x-x^2)/(1-x)^2) \\ Altug Alkan, Mar 26 2016
    

Formula

G.f.: x*(1+x-x^2)/(1-x)^2. - Paul Barry, Aug 05 2004
a(n) = A000203(n) - A048050(n).
a(n) = n+1 for n>1, a(n) = a(n-1)+1 for n>2. - Wesley Ivan Hurt, Mar 13 2016
E.g.f.: (x + 1)*(exp(x) - 1). - Ilya Gutkovskiy, Jun 05 2016
a(n) = n + [n>1], a(n) = 1+n-floor(1/n). - Alan Michael Gómez Calderón, May 12 2023

Extensions

Incorrect formula removed by Charles R Greathouse IV, Mar 18 2010
Showing 1-10 of 62 results. Next