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 21-30 of 154 results. Next

A046413 Numbers k such that the repunit of length k (11...11, with k 1's) has exactly 2 prime factors.

Original entry on oeis.org

3, 4, 5, 7, 11, 17, 47, 59, 71, 139, 211, 251, 311, 347, 457, 461
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1998

Keywords

Comments

347, 457, 461 and 701 are also terms. The only other possible terms up to 1000 are 263, 311, 509, 557, 617, 647 and 991; repunits of these lengths are known to be composite but the linked sources do not provide their factors. - Rick L. Shepherd, Mar 11 2003
The Yousuke Koide reference now shows the repunit of length 263 partially factored; 263 is no longer a possible candidate for this sequence. - Ray Chandler, Sep 06 2005
The repunit of length 263 has 3 prime factors; the repunit of length 617 has one known prime factor and a large composite. Possible terms > 1000 are 1117, 1213, 1259, 1291, 1373, 1447, 1607, 1637, 1663, 1669, 1759, 1823, 1949, 1987, 2063 & 2087. - Robert G. Wilson v, Apr 26 2010
All terms are either primes or squares of primes in A004023. In particular, the only composite below a million is 4. - Charles R Greathouse IV, Nov 21 2014
a(17) >= 509. The only confirmed term below 2500 is 701. As of July 2019, no factorization is known for the potential terms 509, 557, 647, 991, 1117, 1259, 1447, 1607, 1637, 1663, 1669, 1759, 1823, 1949, 1987, 2063, 2087, 2111, 2203, 2269, 2309, 2341, 2467, 2503, 2521, ... Unless the least prime factors of the respective composites have fewer than ~80 decimal digits and are thus accessible by massive ECM computations, there is no chance for an extension using current publicly available factorization methods. See links to factordb.com for the status of the factorization of the smallest unknown terms. - Hugo Pfoertner, Jul 30 2019

Examples

			7 is a term because 1111111 = 239*4649.
		

References

  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.

Crossrefs

Cf. A000042, A004022 (repunit primes), A046053, A102782.

Programs

  • Mathematica
    Select[Range[60],PrimeOmega[FromDigits[PadRight[{},#,1]]]==2&] (* The program generates the first 8 terms of the sequence. *) (* Harvey P. Dale, Aug 26 2024 *)

Extensions

More terms from Rick L. Shepherd, Mar 11 2003
a(13)-a(16) from Robert G. Wilson v, Apr 26 2010

A066180 a(n) = smallest base b so that repunit (b^prime(n) - 1) / (b - 1) is prime, where prime(n) = n-th prime; or 0 if no such base exists.

Original entry on oeis.org

2, 2, 2, 2, 5, 2, 2, 2, 10, 6, 2, 61, 14, 15, 5, 24, 19, 2, 46, 3, 11, 22, 41, 2, 12, 22, 3, 2, 12, 86, 2, 7, 13, 11, 5, 29, 56, 30, 44, 60, 304, 5, 74, 118, 33, 156, 46, 183, 72, 606, 602, 223, 115, 37, 52, 104, 41, 6, 338, 217, 13, 136, 220, 162, 35, 10, 218, 19, 26, 39
Offset: 1

Views

Author

Frank Ellermann, Dec 15 2001

Keywords

Comments

Is a(n) = 0 possible?
Let p be the n-th prime; Cp(x) be the p-th cyclotomic polynomial (x^p - 1)/(x - 1); a(n) is the least k > 1 such that Cp(k) is prime.
The values associated with a(5) and a(8) through a(70) have been certified prime with Primo. (a(1) through a(4), a(6) and a(7) give prime(2), prime(4), prime(11), prime(31), prime(1028) and prime(12251), respectively.)

Examples

			a(5) = 5 because 11 is the 5th prime; (b^5 - 1)/(b - 1) is composite for b = 2,3,4 and prime ((5^11 - 1)/4 = 12207031) for b = 5.
b = 61 for prime(12) = 37 because (61^37 - 1)/60 is prime and 61 is the least base b that makes (b^37 - 1)/(b - 1) a prime.
		

References

  • Paulo Ribenboim, "The New Book of Prime Numbers Records", Springer, 1996, p. 353.

Crossrefs

Cf. A004023 (prime repunits in base 10), A000043 (prime repunits in base 2, Mersenne primes), A055129 (table of repunits).

Programs

  • Mathematica
    Table[p = Prime[n]; b = 1; While[b++; ! PrimeQ[(b^p - 1)/(b - 1)]]; b, {n, 1, 70}] (* Lei Zhou, Oct 07 2011 *)
  • PARI
    /* This program assumes (probable) primes exist for each n. */
    /* All 70 (probable) primes found by this program have been proved prime. */
    gen_repunit(b,n) = (b^prime(n)-1)/(b-1);
    for(n=1,70, b=1; until(isprime(p), b++; p=gen_repunit(b,n)); print1(b,","));

Formula

a(n) = A085398(prime(n)).

Extensions

Sequence extended to 16 terms by Don Reble, Dec 18 2001
More terms from Rick L. Shepherd, Sep 14 2002
Entry revised by N. J. A. Sloane, Jul 23 2006

A092767 Numbers k such that 10^k - 11 is prime.

Original entry on oeis.org

2, 5, 8, 12, 15, 18, 20, 30, 80, 143, 152, 164, 176, 239, 291, 324, 504, 594, 983, 2894, 22226, 35371, 58437, 67863, 180979
Offset: 1

Views

Author

Carl R. White, Apr 23 2004

Keywords

Comments

Some of the larger terms may only correspond to probable primes.
The numbers corresponding to k = 324, 504, 594 & 983 are certified prime by Primo. - Robert G. Wilson v, Jul 01 2005
a(26) > 2.5*10^5. - Robert Price, Apr 12 2015

Examples

			k = 5 is a term because 10^5 - 11 = 100000 - 11 = 99989, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[ If[ PrimeQ[10^n - 11], Print[n]], {n, 3000}] (* Robert G. Wilson v, Jul 01 2005 *)
  • PARI
    for(n=0,5000,if(isprime(10^n-11),print1(n,","))) \\ Ryan Propper, Jun 15 2005

Extensions

4 more terms from Ryan Propper, Jun 15 2005
Edited by N. J. A. Sloane, May 04 2007
a(21)-a(22) from Robert Price, Dec 12 2010
Edited by Ray Chandler, Dec 23 2010
a(23)=58437 and a(24)=67863 from Robert Price, May 29 2011
a(25) from Kamada data by Robert Price, Apr 12 2015

A016114 The smallest representative in a cycle of circular primes, where circular primes are numbers that remain prime under cyclic shifts of digits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 79, 113, 197, 199, 337, 1193, 3779, 11939, 19937, 193939, 199933, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

The next repunit that is prime has 317 digits, all ones. See A004023. - Harvey P. Dale, Mar 22 2012
Only the smallest member of the cyclic shift is listed. See A068652 for all members. - Chai Wah Wu, Nov 09 2015
It is highly likely that all circular primes not on the list above are repunits (see Caldwell link). - Ray Chandler, May 04 2017
Circular primes are A068652 (numbers that remain prime under cyclic shifts of digits). - Tanya Khovanova, Jul 29 2024

Crossrefs

Sequence includes all prime repunits (A004023). Cf. A003459, A293663.
For a sequence listing all the prime-yielding cyclic permutations see A068652.

Programs

  • Mathematica
    circularPrimeQ[p_] := Module[{d = IntegerDigits[p], ps}, ps = Table[FromDigits[d = RotateLeft[d]], {Length[d]}]; If[p > Min[ps], False, And @@ PrimeQ[ps]]]; Select[Prime[Range[100000]], circularPrimeQ] (* T. D. Noe, Mar 22 2012 *)
    Union[Select[Union/@((FromDigits/@Table[RotateRight[IntegerDigits[#],n],{n,IntegerLength[ #]}])&/@Prime[Range[20000]]),AllTrue[#,PrimeQ]&]][[All,1]] (* The program generates the first 19 terms of the sequence. *) (* Harvey P. Dale, Nov 14 2022 *)

Extensions

One more term from Lekraj Beedassy, Nov 07 2002
Name edited by Tanya Khovanova, Jul 29 2024

A070529 Number of divisors of repunit 111...111 (with n digits).

Original entry on oeis.org

1, 2, 4, 4, 4, 32, 4, 16, 12, 16, 4, 128, 8, 16, 64, 64, 4, 384, 2, 128, 128, 96, 2, 1024, 32, 64, 64, 256, 32, 8192, 8, 2048, 64, 64, 128, 3072, 8, 8, 64, 2048, 16, 24576, 16, 1536, 768, 64, 4, 8192, 16, 1024, 256, 512, 16, 8192, 256, 4096
Offset: 1

Views

Author

Henry Bottomley, May 02 2002

Keywords

Examples

			a(9) = 12 since the divisors of 111111111 are 1, 3, 9, 37, 111, 333, 333667, 1001001, 3003003, 12345679, 37037037, 111111111.
		

Crossrefs

Programs

Formula

a(n) = A000005(A002275(n)).
a(n) = A070528(n)*A051064(n)/(A051064(n)+2).
a(A004023(n)) = 2. - Michel Marcus, Sep 09 2015
a(A046413(n)) = 4. - Bruno Berselli, Sep 09 2015

Extensions

Terms to a(280) in b-file from Hans Havermann, Aug 20 2011
a(281)-a(322) in b-file from Ray Chandler, Apr 22 2017
a(323)-a(352) ib b-file from Max Alekseyev, May 04 2022

A128164 Least k > 2 such that (n^k - 1)/(n-1) is prime, or 0 if no such prime exists.

Original entry on oeis.org

3, 3, 0, 3, 3, 5, 3, 0, 19, 17, 3, 5, 3, 3, 0, 3, 25667, 19, 3, 3, 5, 5, 3, 0, 7, 3, 5, 5, 5, 7, 0, 3, 13, 313, 0, 13, 3, 349, 5, 3, 1319, 5, 5, 19, 7, 127, 19, 0, 3, 4229, 103, 11, 3, 17, 7, 3, 41, 3, 7, 7, 3, 5, 0, 19, 3, 19, 5, 3, 29, 3, 7, 5, 5, 3, 41, 3, 3, 5, 3, 0, 23, 5, 17, 5, 11, 7, 61, 3, 3
Offset: 2

Views

Author

Alexander Adamchuk, Feb 20 2007

Keywords

Comments

a(n) = A084740(n) for all n except n = p-1, where p is an odd prime, for which A084740(n) = 2.
All nonzero terms are odd primes.
a(n) = 0 for n = {4,9,16,25,32,36,49,64,81,100,121,125,144,...}, which are the perfect powers with exceptions of the form n^(p^m) where p>2 and (n^(p^(m+1))-1)/(n^(p^m)-1) are prime and m>=1 (in which case a(n^(p^m))=p). - Max Alekseyev, Jan 24 2009
a(n) = 3 for n in A002384, i.e., for n such that n^2 + n + 1 is prime.
a(152) > 20000. - Eric Chen, Jun 01 2015
a(n) is the least number k such that (n^k - 1)/(n-1) is a Brazilian prime, or 0 if no such Brazilian prime exists. - Bernard Schott, Apr 23 2017
These corresponding Brazilian primes are in A285642. - Bernard Schott, Aug 10 2017
a(152) = 270217, see the top PRP link. - Eric Chen, Jun 04 2018
a(184) = 16703, a(200) = 17807, a(210) = 19819, a(306) = 26407, a(311) = 36497, a(326) = 26713, a(331) = 25033; a(185) > 66337, a(269) > 63659, a(281) > 63421, and there are 48 unknown a(n) for n <= 1024. - Eric Chen, Jun 04 2018
Six more terms found: a(522)=20183, a(570)=12907, a(684)=22573, a(731)=15427, a(820)=12043, a(996)=14629. - Michael Stocker, Apr 09 2020

Examples

			a(7) = 5 because (7^5 - 1)/6 = 2801 = 11111_7 is prime and (7^k - 1)/6 = 1, 8, 57, 400 for k = 1, 2, 3, 4. - _Bernard Schott_, Apr 23 2017
		

Crossrefs

Cf. A002384, A049409, A100330, A162862, A217070-A217089. (numbers b such that (b^p-1)/(b-1) is prime for prime p = 3 to 97)
A126589 gives locations of zeros.

Programs

  • Mathematica
    Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[(m^k - 1)/(m - 1)], k++]; k, 0]]@ If[Set[e, GCD @@ #[[All, -1]]] > 1, {#, IntegerExponent[n, #]} &@ Power[n, 1/e] /. {{k_, m_} /; Or[Not[PrimePowerQ@ m], Prime@ m, FactorInteger[m][[1, 1]] == 2] :> 0, {k_, m_} /; m > 1 :> n}, n] &@ FactorInteger@ n, {n, 2, 17}] (* Michael De Vlieger, Apr 24 2017 *)
  • PARI
    a052409(n) = my(k=ispower(n)); if(k, k, n>1)
    a052410(n) = if (ispower(n, , &r), r, n)
    is(n) = issquare(n) || (ispower(n) && !ispseudoprime((n^a052410(a052409(n))-1)/(n-1)))
    a(n) = if(is(n), 0, forprime(p=3, 2^16, if(ispseudoprime((n^p-1)/(n-1)), return(p)))) \\ Eric Chen, Jun 01 2015, corrected by Eric Chen, Jun 04 2018, after Charles R Greathouse IV in A052409 and Michel Marcus in A052410

Extensions

a(18) = 25667 found by Henri Lifchitz, Sep 26 2007

A241100 Smallest prime with length n having at least n-1 identical digits.

Original entry on oeis.org

2, 11, 101, 1117, 10111, 101111, 1111151, 11110111, 101111111, 1111111121, 11111111113, 101111111111, 1111111118111, 11111111111411, 111111111116111, 1111111111111181, 11111111101111111, 101111111111111111, 1111111111111111111, 11011111111111111111
Offset: 1

Views

Author

Michel Lagneau, Apr 16 2014

Keywords

Comments

Conjecture: each term consists of at least n-1 digits 1. - Chai Wah Wu, Dec 10 2015
From Robert G. Wilson v, Dec 14 2015: (Start)
Terms for which the digit d is the other digit besides the 1's:
d:
0: 3, 5, 6, 8, 9, 12, 17, 18, 20, 24, 26, 29, 30, 32, 33, 35, 36, 38, 39, 42, ..., ; n cannot be congruent to 1 (mod 3);
1: 2, 19, 23, not 317, nor 1031, ..., (see A004023); n cannot be congruent to 0 (mod 3)
2: 1, 10, 34, 46, 67, 75, 100, 103, 142, 148, 154, 175, 198, 232, 244, 274, ..., ;
3: 11, 63, 69, 71, 87, 123, 125, 165, 191, 197, 203, 239, 254, 255, 275, 279, ..., ;
4: 14, 31, 55, 76, 85, 91, 95, 109, 121, 127, 130, 143, 155, 163, 166, 178, ..., ;
5: 7, 22, 28, 37, 45, 52, 60, 94, 111, 132, 133, 139, 159, 160, 172, 184, ..., ;
6: 15, 41, 57, 59, 135, 156, 171, 213, 311, 336, 339, 345, 347, 350, 431, ..., ;
7: 4, 40, 47, 58, 64, 70, 101, 106, 112, 115, 118, 131, 136, 145, 157, 169, ..., ;
8: 13, 16, 25, 43, 49, 61, 73, 79, 82, 88, 93, 97, 99, 117, 124, 141, 151, ..., ;
9: 21, 27, 65, 81, 119, 167, 179, 183, 189, 237, 242, 287, 299, 333, 356, ..., . (End)

Programs

  • Maple
    with(numtheory):lst:={}:nn:=80:kk:=0:T:=array(1..nn):U:=array(1..20):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=1:
         od:
         ii:=0:
          for k from 0 to 9 while(ii=0)do:
            for j from 1 to n while(ii=0)do:
            T[j]:=k:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true and length(s)=n
             then
             ii:=1: kk:=kk+1:U[kk]:=s:
             else
             T[j]:=1:
             fi:
           od:
         od:
        od :
         print(U) :
  • Mathematica
    f[n_] := Block[{k = n - 2, p = 0, r = (10^n - 1)/9, s}, If[ Mod[n, 3] != 1, While[p = r - 10^k; k > 0 && ! PrimeQ@ p, k--]]; If[ Mod[p, 10] == 0, k = 0; s = Select[Range[0, 8], Mod[# + n, 3] > 0 &]; While[p = Select[r + 10^k*s, PrimeQ]; k < n && p == {}, k++]]; p = Min@ p]; Array[f, 20] (* Robert G. Wilson v, Dec 14 2015 *)
    Table[SelectFirst[Sort[Flatten[Table[Select[FromDigits/@Permutations[PadRight[{d},n,1]],IntegerLength[#] == n&],{d,0,9}]]],PrimeQ],{n,20}] (* Assumes that Chai Wah Wu's conjecture, above, is correct. *) (* Harvey P. Dale, Oct 23 2024 *)
  • Python
    from _future_ import division
    from sympy import isprime
    def A241100(n):
        for i in range(1,10):
            x = i*(10**n-1)//9
            for j in range(n-1,-1,-1):
                for k in range(i,-1,-1):
                    if j < n-1 or k < i:
                        y = x-k*(10**j)
                        if isprime(y):
                            return y
            for j in range(n):
                for k in range(1,9-i+1):
                    y = x+k*(10**j)
                    if isprime(y):
                        return y # Chai Wah Wu, Dec 29 2015

Extensions

a(4), a(7), a(10), a(11), a(13)-a(16) corrected by Chai Wah Wu, Dec 10 2015
a(1) from Robert G. Wilson v, Dec 11 2015

A258706 Absolute primes: every permutation of digits is a prime. Only the smallest representative of each permutation class is shown.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 79, 113, 199, 337, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

N. J. A. Sloane, Jun 09 2015

Keywords

Comments

See the main entry, A003459, for further information and references cited below.
The next terms are the repunit primes (A004023) R(317), too large to be displayed here, and R(1031), too large even for a b-file. Johnson (1977) proves that subsequent terms must be of the form a*R(n) + b*10^k, with a and a+b in {1..9}, k < n, and n > 9*10^9 if b != 0. - M. F. Hasler, Jun 26 2018

Crossrefs

Cf. A003459, A004023, A004022 (subsequence of repunit primes).

Programs

  • Haskell
    import Data.List (permutations, (\\))
    a258706 n = a258706_list !! (n-1)
    a258706_list = f a000040_list where
       f ps'@(p:ps) | any (== 0) (map a010051' dps) = f ps
                    | otherwise = p : f (ps' \\ dps)
                    where dps = map read $ permutations $ show p
    -- Reinhard Zumkeller, Jun 10 2015
    
  • Mathematica
    Flatten@{2, 3, 5, 7,
      Table[Select[
        Table @@
          Prepend[Prepend[
            Table[{A@k, A[k - 1], 4}, {k, 2, n}], {A[1], 4}],
           Unevaluated[
            Unevaluated[FromDigits[{1, 3, 7, 9}[[A /@ Range[n]]]]]]] //
         Flatten,
        Function[L,
           And[PrimeQ[#],
            And @@ PrimeQ[
              FromDigits /@ (Permute[L, #] & /@
                 RandomPermutation[Length@L, 5])],
            And @@ PrimeQ[FromDigits /@ Rest[Permutations[L]]]]]@
          IntegerDigits@# &], {n, 2, 33}]}
    (* Exhaustively searches thru 33 digits in ~7.5 sec, and up to 69 digits in 5 min, but cannot reach 317 digits. Not helpful in the light of Schroeppel's theorem that it's all repunits past 991. - Bill Gosper, Jan 06 2017 *)
  • PARI
    {A=[2,5]; for(n=1, 317, my(D=[1,3,7,9], r=10^n\9); for(a=1,4, for(b=a^(n<3),4, for(j=0, if(b!=a,n-1), ispseudoprime(D[a]*r+(D[b]-D[a])*10^j)||next(2)); A=setunion(A, [r*D[a]+(D[b]-D[a])*10^if(b=n[1] && #select(d->d,n[^1]-n[^-1])<2 && !for(i=1,(#n)^(n[#n]>1), isprime(fromdigits(n=concat(n[^1],n[1])))||return)} \\ By Johnson's theorem and minimality required here, the number must be of the form ab...b or a...ab (=> first difference of digits has at most 1 nonzero component) and then is sufficient to consider rotations of the digits.
    \\ M. F. Hasler, Jun 26 2018

A372034 For a positive number k, let L(k) denote the list consisting of k followed by the prime factors of k, with repetition, in nondecreasing order; sequence gives composite k such that the digits of L(k) are in nonincreasing order.

Original entry on oeis.org

4, 8, 9, 22, 32, 33, 44, 55, 64, 77, 88, 93, 99, 422, 633, 775, 844, 933, 993, 4222, 4442, 6333, 6655, 6663, 7533, 7744, 7775, 8444, 8884, 9663, 9993, 44222, 66333, 88444, 99633, 99933, 99993, 933333, 966333, 996663, 999993, 4442222, 6663333, 7777775, 8884444, 9663333, 9666633, 9666663
Offset: 1

Views

Author

Scott R. Shannon, Apr 16 2024

Keywords

Comments

Is it true that no terms end with 1? A separate search on those shows none with < 70 digits. Michael S. Branicky, Apr 23 2024
Testing all products of repunit primes (A004022, A004023), there are no terms ending in 1 less than 10^3000. - Michael S. Branicky, Apr 24 2024

Examples

			The initial terms and their factorizations are:
4 = [2, 2]
8 = [2, 2, 2]
9 = [3, 3]
22 = [2, 11]
32 = [2, 2, 2, 2, 2]
33 = [3, 11]
44 = [2, 2, 11]
55 = [5, 11]
64 = [2, 2, 2, 2, 2, 2]
77 = [7, 11]
88 = [2, 2, 2, 11]
93 = [3, 31]
99 = [3, 3, 11]
422 = [2, 211]
633 = [3, 211]
775 = [5, 5, 31]
844 = [2, 2, 211]
933 = [3, 311]
993 = [3, 331]
4222 = [2, 2111]
4442 = [2, 2221]
6333 = [3, 2111]
6655 = [5, 11, 11, 11]
6663 = [3, 2221]
7533 = [3, 3, 3, 3, 3, 31]
7744 = [2, 2, 2, 2, 2, 2, 11, 11]
...
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    def ni(s): return sorted(s, reverse=True) == list(s)
    def ok(n):
        if n < 4 or isprime(n): return False
        s, f = str(n), "".join(str(p)*e for p, e in factorint(n).items())
        return ni(s+f)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Apr 23 2024
    
  • Python
    # faster for initial segment of sequence
    from sympy import factorint, isprime
    from itertools import islice, combinations_with_replacement as mc
    def ni(s): return s == "".join(sorted(s, reverse=True))
    def bgen(d):
        yield from ("".join(m) for m in mc("987654321", d))
    def agen(): # generator of terms
        for d in range(1, 70):
            out = set()
            for s in bgen(d):
                t = int(s)
                if t < 4 or isprime(t): continue
                if ni(s+"".join(str(p)*e for p, e in factorint(t).items())):
                    out.add(t)
            yield from sorted(out)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Apr 23 2024

A378761 Irregular triangle read by rows: T(n,k) for k <= n/2 is the number of partitions of the repunit A002275(n) into k nonzero complementary binary vectors having a common divisor > 1 in base 10.

Original entry on oeis.org

1, 1, 1, 3, 1, 0, 1, 19, 6, 1, 0, 0, 1, 47, 98, 29, 1, 84, 280, 0, 1, 141, 650, 600, 120, 1, 0, 0, 0, 0, 1, 1135, 16734, 28063, 5922, 756, 1, 130, 130, 13, 0, 0, 1, 1779, 43757, 161700, 161700, 52920, 5040, 1, 6183, 263386, 1401900, 1401400, 0, 0, 1, 9919, 438582, 2634549, 4381246, 2587326, 577612, 40913, 1, 0, 0, 0, 0, 0, 0, 0, 1, 75433
Offset: 2

Views

Author

Dmytro Inosov, Dec 06 2024

Keywords

Comments

We call a k-tuple of binary vectors of length n complementary if for every position m (1 <= m <= n) the digit "1" occurs on that position in exactly one of the vectors. For example, {1010, 0100, 0001} is a triple (k=3) of complementary binary vectors of length n=4. The sum of complementary binary vectors of length n is always a repunit of the same length, A002275(n).
T(n,k) gives the number of distinct unordered k-tuples of complementary binary vectors of length n that have a common divisor > 1 as integers in base 10.
For k > n/2, at least one of the binary vectors must contain just a single "1" (with all other digits zero) and is, therefore, a power of 10 (A011557). Hence it cannot have nontrivial common divisors with the repunit A002275(n), which implies T(n,k) = 0. The requirement k <= n/2 acts to skip the corresponding trivial zero terms.
The partitions for k = 1 are trivial and consist of one element -- the repunit itself, which is its own greatest common divisor. Therefore, T(n,1) = 1 for n >= 2.
If T(n,k)=0 for some n and k, then T(n,m)=0 also for any m >= k. Indeed, if some m-tuple of binary vectors existed that is counted toward T(n,m), then an (m-1)-tuple obtained by summing any two of its vectors while leaving others unchanged would be counted toward T(n,m-1). By induction, this leads to T(n,k)>0, which is a contradiction.
Consequently, T(n,k) = 0 for all k > 1 whenever A378511(n) = 1. This holds, in particular, for all n in A004023 (indices of prime repunits).

Examples

			The triangle T(n,k) starts (omitting terms with k > n/2, which are zero):
-----------------------------------------------------------------------------------------
n\k: 1,       2,         3,         4,         5,         6,        7,       8,   9,  ...
-----------------------------------------------------------------------------------------
 2 | 1;
 3 | 1;
 4 | 1,       3;
 5 | 1,       0;
 6 | 1,      19,         6;
 7 | 1,       0,         0;
 8 | 1,      47,        98,        29;
 9 | 1,      84,       280,         0;
10 | 1,     141,       650,       600,       120;
11 | 1,       0,         0,         0,         0;
12 | 1,    1135,     16734,     28063,      5922,       756;
13 | 1,     130,       130,        13,         0,         0;
14 | 1,    1779,     43757,    161700,    161700,     52920,     5040;
15 | 1,    6183,    263386,   1401900,   1401400,         0,        0;
16 | 1,    9919,    438582,   2634549,   4381246,   2587326,   577612,   40913;
17 | 1,       0,         0,         0,         0,         0,        0,       0;
18 | 1,   75433,  10808037, 140403209, 391178517, 290493433, 39663279, 6540609, 362880;
19 | 1,       0,         0,         0,         0,         0,        0,       0,      0;
20 | 1,  124467,  26825456, 514583021, ...
... (for more terms, see the A-file).
T(6,3) = 6 because among the {n,k} = 90 possible triples of nonzero binary vectors of length 6 there are exactly 6 with a common divisor > 1:
  {100001, 010010, 001100}: GCD(100001, 10010, 1100) = 11;
  {100001, 011000, 000110}: GCD(100001, 11000, 110) = 11;
  {100100, 010010, 001001}: GCD(100100, 10010, 1001) = 1001;
  {100100, 011000, 000011}: GCD(100100, 11000, 11) = 11;
  {110000, 001001, 000110}: GCD(110000, 1001, 110) = 11;
  {110000, 001100, 000011}: GCD(110000, 1100, 11) = 11.
The quadruple of binary vectors {1100000001000, 0010001100000, 0001100000001, 0000010010110} counts toward T(13,4) because in base 10, GCD(1100000001000, 10001100000, 1100000001, 10010110) = 53. In total, there are 13 such quadruples of length 13. This exemplifies the smallest prime n with nontrivial T(n,k).
T(17,k) = 0 for k >= 2 since A378511(17) = 1 (though 17 isn't a term in A004023).
T(317,k) = 0 for k >= 2 since 317 is a term in A004023.
		

Crossrefs

Programs

  • Mathematica
    Clear[SubListNonCoprimes];
    SubListNonCoprimes[bnum_, m_] := SubListNonCoprimes[bnum, m] =
      (If[m == 1, Return[If[bnum == Repunit, Nothing, {Repunit - bnum}]]];
      ListOfParts2 = Select[Total[10^(ResourceFunction["KSetPartitions"][(#)[[Range[Length[#]]]], 2] &[Position[IntegerDigits[bnum] // Reverse, 0] // Flatten] - 1), {3}] /. 0 -> {}, GCD @@ Prepend[#, bnum] > 1 &];
      If[m == 2, ListOfParts2, Select[Flatten[MapApply[Append]@*Thread@*
    Comap[{SubListNonCoprimes[# + bnum, m-1] &, Identity}] @* Max /@ ListOfParts2, 1], GCD @@ Prepend[#, bnum] > 1 &]]);
    SubCountNonCoprimes10[n_, m_, k_, totk_] := (Result = 0; Do[If[!CoprimeQ[#, Repunit-#],
    Result += Length[SubListNonCoprimes[#, m-1]]] &[FromDigits[IntegerDigits[i, 2]]], {i, #[[k]], #[[k+1]]-1}] &[Round[Subdivide[2^(n-1), 2^n, totk]]];
      Result);
    CountNonCoprimes10[n_, m_] := (If[m > n/2, Return[0], If[m == 1, Return[1]]];
      Repunit = (10^n - 1)/9; ParallelSum[SubCountNonCoprimes10[n, m, k, #], {k, #}, Method -> "FinestGrained", ProgressReporting -> (n >= 15)] &[If[n >= 15, 100, 1] $KernelCount]);
    Table[CountNonCoprimes10[n, k], {n, 2, 16}, {k, 1, 8}] // TableForm

Formula

T(n,k) = 0 for k > n/2 (such terms are skipped as trivial zeros).
T(n,1) = 1 for n >= 2.
T(n,1) + T(n,2) = A378511(n).
Sum_{k} T(n,k) = A385539(n) (row sums).
T(n,k) = Stirling2(n,k) - A378154(n,k) for 2 <= k <= 9.
T(A004023(n),k) = 0 for k >= 2.
Previous Showing 21-30 of 154 results. Next