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 12 results. Next

A278984 Array read by antidiagonals downwards: T(b,n) = number of words of length n over an alphabet of size b that are in standard order.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 8, 5, 2, 1, 1, 16, 14, 5, 2, 1, 1, 32, 41, 15, 5, 2, 1, 1, 64, 122, 51, 15, 5, 2, 1, 1, 128, 365, 187, 52, 15, 5, 2, 1, 1, 256, 1094, 715, 202, 52, 15, 5, 2, 1, 1, 512, 3281, 2795, 855, 203, 52, 15, 5, 2, 1, 1, 1024, 9842, 11051, 3845, 876, 203, 52, 15, 5, 2, 1
Offset: 1

Views

Author

Joerg Arndt and N. J. A. Sloane, Dec 05 2016

Keywords

Comments

We study words made of letters from an alphabet of size b, where b >= 1. We assume the letters are labeled {1,2,3,...,b}. There are b^n possible words of length n.
We say that a word is in "standard order" if it has the property that whenever a letter i appears, the letter i-1 has already appeared in the word. This implies that all words begin with the letter 1.
Let X be the random variable that assigns to each permutation of {1,2,...,b} (with uniform distribution) its number of fixed points (as in A008290). Then T(b,n) is the n-th moment about 0 of X, i.e., the expected value of X^n. - Geoffrey Critzer, Jun 23 2020

Examples

			The array begins:
1,.1,..1,...1,...1,...1,...1,....1..; b=1, A000012
1,.2,..4,...8,..16,..32,..64,..128..; b=2, A000079
1,.2,..5,..14,..41,.122,.365,.1094..; b=3, A007051 (A278985)
1,.2,..5,..15,..51,.187,.715,.2795..; b=4, A007581
1,.2,..5,..15,..52,.202,.855,.3845..; b=5, A056272
1,.2,..5,..15,..52,.203,.876,.4111..; b=6, A056273
...
The rows tend to A000110.
		

Crossrefs

Rows 1 through 16 of the array are: A000012, A000079, A007051 (or A124302), A007581 (or A124303), A056272, A056273, A099262, A099263, A164863, A164864, A203641-A203646.
The limit of the rows is A000110, the Bell numbers.
See A278985 for the words arising in row b=3.
Cf. A203647, A137855 (essentially same table).

Programs

  • Maple
    with(combinat);
    f1:=proc(L,b) local t1;i;
    t1:=add(stirling2(L,i),i=1..b);
    end:
    Q1:=b->[seq(f1(L,b), L=1..20)]; # the rows of the array are Q1(1), Q1(2), Q1(3), ...
  • Mathematica
    T[b_, n_] := Sum[StirlingS2[n, j], {j, 1, b}]; Table[T[b-n+1, n], {b, 1, 12}, {n, b, 1, -1}] // Flatten (* Jean-François Alcover, Feb 18 2017 *)

Formula

The number of words of length n over an alphabet of size b that are in standard order is Sum_{j = 1..b} Stirling2(n,j).

A203647 T(n,k) = number of arrays of n 0..k integers with new values introduced in order 0..k but otherwise unconstrained. Array read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 5, 8, 1, 2, 5, 14, 16, 1, 2, 5, 15, 41, 32, 1, 2, 5, 15, 51, 122, 64, 1, 2, 5, 15, 52, 187, 365, 128, 1, 2, 5, 15, 52, 202, 715, 1094, 256, 1, 2, 5, 15, 52, 203, 855, 2795, 3281, 512, 1, 2, 5, 15, 52, 203, 876, 3845, 11051, 9842, 1024, 1, 2, 5, 15, 52, 203, 877
Offset: 1

Views

Author

R. H. Hardin, Jan 04 2012

Keywords

Comments

Table starts
....1.....1......1......1......1......1......1......1......1......1......1
....2.....2......2......2......2......2......2......2......2......2......2
....4.....5......5......5......5......5......5......5......5......5......5
....8....14.....15.....15.....15.....15.....15.....15.....15.....15.....15
...16....41.....51.....52.....52.....52.....52.....52.....52.....52.....52
...32...122....187....202....203....203....203....203....203....203....203
...64...365....715....855....876....877....877....877....877....877....877
..128..1094...2795...3845...4111...4139...4140...4140...4140...4140...4140
..256..3281..11051..18002..20648..21110..21146..21147..21147..21147..21147
..512..9842..43947..86472.109299.115179.115929.115974.115975.115975.115975
.1024.29525.175275.422005.601492.665479.677359.678514.678569.678570.678570
Lower left triangular part seems to be A102661. - R. J. Mathar, Nov 29 2015

Examples

			Some solutions for n=7, k=5:
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..0....0....1....1....1....1....0....0....1....1....1....1....1....1....1....1
..1....0....2....1....2....2....1....1....2....2....2....2....1....2....1....2
..0....1....1....0....3....3....2....2....1....3....1....1....1....0....0....2
..0....0....3....1....0....4....3....0....2....3....1....1....1....0....2....1
..2....2....4....2....2....0....4....2....0....2....2....3....2....3....2....0
..1....3....1....0....2....5....0....0....0....0....0....2....2....1....1....1
		

Crossrefs

Column 1 is A000079(n-1).
Column 2 is A007051(n-1).
Column 3 is A007581(n-1).
Column 4 is A056272.
Column 5 is A056273.
Column 6 is A099262.
Column 7 is A099263.
Column 8 is A164863.
Column 9 is A164864.
Column 10 is A203641.
Column 11 is A203642.
Column 12 is A203643.
Column 13 is A203644.
Column 14 is A203645.
Column 15 is A203646.
Diagonal is A000110.

Programs

  • Maple
    T:= proc(n,k) option remember;  if k = 1 then 2^(n-1)
    else 1 + add(binomial(n-1,j-1)*procname(n-j,k-1),j=1..n-1)
    fi
    end proc:
    seq(seq(T(k,m-k),k=1..m-1),m=2..10); # Robert Israel, May 20 2016
  • Mathematica
    T[n_, k_] := Sum[StirlingS2[n, j], {j, 1, k+1}]; Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 31 2017, after Andrew Howroyd *)

Formula

T(n,k) = Sum_{j = 1..k+1} Stirling2(n,j). - Andrew Howroyd, Mar 19 2017
T(n,k) = A278984(k+1, n). - Andrew Howroyd, Mar 19 2017
Empirical for column k:
k=1: a(n) = 2*a(n-1)
k=2: a(n) = 4*a(n-1) -3*a(n-2)
k=3: a(n) = 7*a(n-1) -14*a(n-2) +8*a(n-3)
k=4: a(n) = 11*a(n-1) -41*a(n-2) +61*a(n-3) -30*a(n-4)
k=5: a(n) = 16*a(n-1) -95*a(n-2) +260*a(n-3) -324*a(n-4) +144*a(n-5)
k=6: a(n) = 22*a(n-1) -190*a(n-2) +820*a(n-3) -1849*a(n-4) +2038*a(n-5) -840*a(n-6)
k=7: a(n) = 29*a(n-1) -343*a(n-2) +2135*a(n-3) -7504*a(n-4) +14756*a(n-5) -14832*a(n-6) +5760*a(n-7)
k=8: a(n) = 37*a(n-1) -574*a(n-2) +4858*a(n-3) -24409*a(n-4) +74053*a(n-5) -131256*a(n-6) +122652*a(n-7) -45360*a(n-8)
k=9: a(n) = 46*a(n-1) -906*a(n-2) +9996*a(n-3) -67809*a(n-4) +291774*a(n-5) -790964*a(n-6) +1290824*a(n-7) -1136160*a(n-8) +403200*a(n-9)
k=10: a(n) = 56*a(n-1) -1365*a(n-2) +19020*a(n-3) -167223*a(n-4) +965328*a(n-5) -3686255*a(n-6) +9133180*a(n-7) -13926276*a(n-8) +11655216*a(n-9) -3991680*a(n-10)
k=11: a(n) = 67*a(n-1) -1980*a(n-2) +33990*a(n-3) -375573*a(n-4) +2795331*a(n-5) -14241590*a(n-6) +49412660*a(n-7) -113667576*a(n-8) +163671552*a(n-9) -131172480*a(n-10) +43545600*a(n-11)
k=12: a(n) = 79*a(n-1) -2783*a(n-2) +57695*a(n-3) -782133*a(n-4) +7284057*a(n-5) -47627789*a(n-6) +219409685*a(n-7) -703202566*a(n-8) +1519272964*a(n-9) -2082477528*a(n-10) +1606986720*a(n-11) -518918400*a(n-12)
k=13: a(n) = 92*a(n-1) -3809*a(n-2) +93808*a(n-3) -1530243*a(n-4) +17419116*a(n-5) -141963107*a(n-6) +835933384*a(n-7) -3542188936*a(n-8) +10614910592*a(n-9) -21727767984*a(n-10) +28528276608*a(n-11) -21289201920*a(n-12) +6706022400*a(n-13)
k=14: a(n) = 106*a(n-1) -5096*a(n-2) +147056*a(n-3) -2840838*a(n-4) +38786748*a(n-5) -385081268*a(n-6) +2816490248*a(n-7) -15200266081*a(n-8) +59999485546*a(n-9) -169679309436*a(n-10) +331303013496*a(n-11) -418753514880*a(n-12) +303268406400*a(n-13) -93405312000*a(n-14)
k=15: a(n) = 121*a(n-1) -6685*a(n-2) +223405*a(n-3) -5042947*a(n-4) +81308227*a(n-5) -965408015*a(n-6) +8576039615*a(n-7) -57312583328*a(n-8) +287212533608*a(n-9) -1066335473840*a(n-10) +2866534951280*a(n-11) -5367984964224*a(n-12) +6557974412544*a(n-13) -4622628648960*a(n-14) +1394852659200*a(n-15)
From Robert Israel, May 20 2016: (Start)
T(n,k) = 1 + Sum_{j=1..n-1} binomial(n-1,j-1)*T(n-j,k-1).
G.f. for columns g_k(z) satisfies g_k(z) = (z/(1-z))*(1+ g_{k-1}(z/(1-z))) with g_1(z) = z/(1-2z).
Thus g_k is a rational function: it has a simple pole at z=1/j for 1<=j<=k+1 except j=k, and it has a finite limit at infinity (so the degree of the numerator is k). This implies that column k satisfies the recurrences listed above, whose coefficients correspond to the expansion of (z-1/(k+1))* Product_{j=1..k-1}(z - 1/j).
(End)

A203641 Number of arrays of n 0..10 integers with new values introduced in order 0..10 but otherwise unconstrained.

Original entry on oeis.org

1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213596, 27644358, 190895863, 1382847419, 10477213268, 82797679445, 680685836527, 5806124780384, 51245294979716, 466668627500968, 4371727233798927, 42000637216351225
Offset: 1

Views

Author

R. H. Hardin, Jan 04 2012

Keywords

Comments

From Danny Rorabaugh, Mar 03 2015: (Start)
a(n) is also the number of ways of placing n labeled balls into 11 indistinguishable boxes.
a(n) is also the number of word structures of length n using an 11-ary alphabet.
(End)

Crossrefs

Column k=10 of A203647.

Programs

  • Maple
    f:= n -> add(Stirling2(n,k),k=1..11):
    map(f, [$1..100]); # Robert Israel, Aug 08 2016
  • PARI
    a(n) = sum(k=1,11,stirling(n,k, 2)); \\ Michel Marcus, Mar 03 2015

Formula

Empirical: a(n) = 56*a(n-1) -1365*a(n-2) +19020*a(n-3) -167223*a(n-4) +965328*a(n-5) -3686255*a(n-6) +9133180*a(n-7) -13926276*a(n-8) +11655216*a(n-9) -3991680*a(n-10).
a(n) = Sum_{k=1..11} stirling2(n,k). - Danny Rorabaugh, Mar 03 2015
G.f.: Sum_{k=1..11} Product_{j=1..k} x/(1-j*x). This confirms the empirical recurrence. - Robert Israel, Aug 08 2016

A266946 Smallest number of each digital type.

Original entry on oeis.org

1, 10, 11, 100, 101, 102, 110, 111, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1022, 1023, 1100, 1101, 1102, 1110, 1111, 10000, 10001, 10002, 10010, 10011, 10012, 10020, 10021, 10022, 10023, 10100, 10101, 10102, 10110, 10111, 10112, 10120, 10121, 10122, 10123, 10200, 10201, 10202, 10203, 10210, 10211, 10212, 10213, 10220, 10221, 10222, 10223, 10230, 10231, 10232, 10233, 10234, 11000, 11001, 11002, 11010, 11011, 11012, 11020, 11021, 11022, 11023, 11100, 11101, 11102, 11110, 11111
Offset: 1

Views

Author

Vladimir Shevelev, Jan 06 2016

Keywords

Comments

The smallest single-digit positive number is 1. This is the first type.
The smallest of the two-digit positive numbers with distinct digits is 10. This is the second type. The smallest of two-digit positive numbers with equal digits is 11. This is the third type, etc.
A digital type is an equivalence class of integers that share the same pattern of identical digits. a(n) defines a possible canonical form for this equivalence relation. It can be obtained from the distinct terms in A358497 after the following digit replacement: {1->1, 2->0, 3->2, 4->3, 5->4, 6->5, 7->6, 8->7, 9->8, 0->9}. - Dmytro Inosov, Nov 14 2024

Examples

			The first 3-digit number is 100 = a(4).
The following number is 101. It does not belong to the type 100, since the first and the third digits coincide in 101, while in 100 they do not. So 101 is a new type, and a(5)=101.
Next consider 102. Here there are 3 distinct digits, so 102 is a new type, and a(6)=102. However, 103, 104, 105, 106, 107, 108, 109 also have 3 distinct digits, i.e., they belong to type 102.
Further, 110 belongs to neither type 100 nor type 101, since in 110 the first and the second digits coincide, while not in 100 and 101, so a(7)=110; also 111 is a new type, where all digits coincide.
Now we see that every 3-digit number is of one of the 5 types a(4), a(5), a(6), a(7), a(8).
Next we consider the first 4-digit number a(9)=1000, etc.
		

Crossrefs

Formula

The number of distinct types of k-digit numbers equals A164864(k).

Extensions

More terms from Peter J. C. Moses, Jan 06 2016

A164863 Number of ways of placing n labeled balls into 9 indistinguishable boxes; word structures of length n using a 9-ary alphabet.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115974, 678514, 4211825, 27602602, 190077045, 1368705291, 10254521370, 79527284317, 635182667816, 5199414528808, 43426867585575, 368654643520692, 3170300933550687, 27542984610086665, 241205285284001240
Offset: 0

Views

Author

Alois P. Heinz, Aug 28 2009

Keywords

Crossrefs

Programs

  • Maple
    # first program:
    a:= n-> ceil(103/560*2^n +53/864*3^n +11/720*4^n +5^n/320 +6^n/2160 +7^n/10080 +9^n/362880): seq(a(n), n=0..25);
    # second program:
    a:= n-> add(Stirling2(n, k), k=0..9): seq(a(n), n=0..25);
  • Mathematica
    Table[Sum[StirlingS2[n, k], {k, 0, 9}], {n, 0, 30}] (* Robert A. Russell, Apr 25 2018 *)

Formula

a(n) = Sum_{k=0..9} stirling2 (n,k).
a(n) = ceiling (103/560*2^n +53/864*3^n +11/720*4^n +5^n/320 +6^n/2160 +7^n/10080 +9^n/362880).
G.f.: (16687*x^8 -67113*x^7 +88620*x^6 -56993*x^5 +20529*x^4 -4353*x^3 +539*x^2 -36*x+1) / ((9*x-1) *(7*x-1) *(6*x-1) *(5*x-1) *(4*x-1) *(3*x-1) *(2*x-1) *(x-1)).
G.f.: Sum_{j=0..k} A248925(k,j)*x^j / Product_{j=1..k} 1-j*x with k=9. - Robert A. Russell, Apr 25 2018

A376918 Number of digit patterns of length n without common prime factors of a different digital type.

Original entry on oeis.org

1, 2, 4, 11, 51, 177, 876, 3965, 20782, 114462, 678568, 4160919, 27640938, 190402900, 1378295071, 10437144322, 82285618466, 671415306221, 5676395537455
Offset: 1

Views

Author

Dmytro Inosov, Oct 10 2024

Keywords

Comments

a(n) gives the number of distinct digit patterns (or digital types, as per A266946) such that all integers of that digital type share no common prime factor of a different digital type.
The number of remaining digit patterns not counted toward a(n) is given by A378199(n).
To check whether a digit pattern of length n with distinct digits A,B,... should be counted toward a(n), write that pattern as a linear combination of the form X1*A + X2*B + ..., where the pattern coefficients X1,X2,... consist of 0's and 1's (A007088), with 1's on positions of the corresponding digit in the pattern.
If GCD(X1,X2,...) has no prime divisors with a different digit pattern from the one we started from, the pattern is counted toward a(n). Otherwise, it is excluded.
For n of the form 10m + 3q (with m >= 1 and q >= 0), check in addition if the pattern contains all 10 distinct digits whose number of occurrences taken modulo 3 is the same for all digits from A to J. Since A + B + ... + J = 45, which is divisible by 9, such patterns are not counted toward a(n) and should be excluded.
The digital types excluded in this way result in composites for any values of the distinct digits in the pattern, without the need to run primality tests on all numbers of that digital type individually.
The requirement for a divisor of a different digital type only affects reprigits of the form AA..AA and acts to include that pattern iff the n-repunit is prime (n in A004023).
a(n) gives the upper bound for the number of distinct digital types of n-digit primes A267013(n). The two sequences are distinct, since some digit patterns such as "AAABBCABCCCAACCB" happen to contain no primes accidentally, without having a common divisor. We call such patterns primonumerophobic. Sequence A377727 = {a(n)-A267013(n)}_(n>=1) gives the number of primonumerophobic digit patterns of length n.
a(n) coincides with A267013(n) for n<10 because the shortest primonumerophobic digit patterns "AAABBBAAAB", "AABABBBBBA", and "ABAAAAABBB" have length 10.
a(n) represents row sums of T(n,k) in A378154 -- an array of contributions to a(n) with exactly k<=10 distinct decimal digits.
A164864(n) gives the total number of possible digit patterns of length n and is therefore an upper bound for a(n).

Examples

			The pattern "ABCA" is counted toward a(4) because ABCA = A*1001 + B*100 + C*10. Since GCD(1001,100,10) = 1, integers of the digital type "ABCA" (1021 in A266946) share no common prime factors.
The pattern "AA" is counted toward a(2) because AA = A*11, and 11 is a prime repunit. The only common prime factor shared by the repdigits "AA" is 11, which is of the same digital type as the original pattern.
The pattern "ABAB" is not counted toward a(4) because it is divisible by 101 for any A > 0 and B >= 0, and 101 has a different digital type from ABAB. Indeed, ABAB = A*1010+B*101, which is identically divisible by 101. In total there are four 4-digit patterns that are excluded: ABBA, AABB, AAAA (all of them divisible by 11) and ABAB (divisible by 101). Therefore, a(4) = A164864(4)-4 = 11.
The pattern "ABCDEFGHIJ" that contains all possible digits exactly once does not contribute to a(10) because its sum of digits is 1+2+...+9 = 45, which is divisible by 9. Therefore, all integers with the digital type "ABCDEFGHIJ" share the common prime factor 3.
a(23) = 37135226382208300 -- the fact that n = 23 is a term in A004023 (indices of prime repunits) simplifies the calculation of A378154(n,k) since A378761(23,k) = 0 for all k > 1. - _Dmytro Inosov_, Dec 21 2024
		

Crossrefs

Programs

  • Mathematica
    MinLength = 1; MaxLength = 12; (* the range of n to calculate a(n) for *)
    (* Function that calculates the canonical form A358497(n) *)
    A358497[k_] := FromDigits@a358497C[k]
    a358497C = Compile[{{k, _Integer}}, Module[{firstpos = ConstantArray[0, 10],
      digits = IntegerDigits[k], indx = 0}, Table[If[firstpos[[digits[[j]] + 1]] == 0, firstpos[[digits[[j]] + 1]] = Mod[++indx,10]];
      firstpos[[digits[[j]] + 1]], {j, Length[digits]}]]];
    (* Function that checks if a common prime factor of a different digital type exists *)
    DivisibilityRulesQ[pat_] := (
      If[Divisible[Length[pat], 10] && Length[Counts[pat]] == 10 &&
         AllTrue[Table[Counts[pat][[i]] == Length[pat]/10, {i, 1, 10}], TrueQ], Return[True]];
      (# != 1) && AnyTrue[Extract[# // FactorInteger, {All, 1}],
         A358497[#] != A358497[pat // FromDigits] &] &[
         Apply[GCD, Total[10^(Position[Reverse[pat], #]-1) // Flatten]& /@
         Mod[Range[CountDistinct[pat]], 10]]]
    );
    (* Function that generates all patterns that do not satisfy divisibility rules *)
    Patterns[len_, k_] := (
      Clear[dfs];
      ResultingPatterns = {};
      dfs[number_List] := If[Length[number] == len,
        If[Length[Union[If[# < 10, #, 0] & /@ number]] == k,
          AppendTo[ResultingPatterns, If[# < 10, #, 0] & /@ number]],
        Do[If[i <= 10, dfs[Append[number, i]]], {i, Range[1, Last[Union[number]] + 1]}]];
      dfs[{1}];
      FromDigits /@ Select[ResultingPatterns, ! DivisibilityRulesQ[#] &]
    );
    (* Counting the patterns T(n,k) as per A378154 and their row sums a(n) *)
    Do[Print[{n, #, Sum[#[[m]], {m, 1, Length[#]}]}] &[Table[Length[Patterns[n, j]], {j, 1, Min[10, n]}]], {n, MinLength, MaxLength}];

Formula

a(n) = Sum_{k=1..min(n,10)} T(n,k) -- row sums of A378154.
A267013(n) <= a(n) <= A164864(n).
a(n) = A164864(n) - A378199(n).
a(n) = A267013(n) + A377727(n).

Extensions

a(13)-a(19) from Dmytro Inosov, Dec 23 2024

A378154 Array read by rows: T(n,k) for k <= min(n,10) is the number of digital types of length n with exactly k distinct decimal digits without common prime factors of a different digital type.

Original entry on oeis.org

1, 1, 1, 0, 3, 1, 0, 4, 6, 1, 0, 15, 25, 10, 1, 0, 12, 84, 65, 15, 1, 0, 63, 301, 350, 140, 21, 1, 0, 80, 868, 1672, 1050, 266, 28, 1, 0, 171, 2745, 7770, 6951, 2646, 462, 36, 1, 0, 370, 8680, 33505, 42405, 22827, 5880, 750, 45, 0, 0, 1023, 28501, 145750, 246730, 179487, 63987, 11880, 1155, 55
Offset: 1

Views

Author

Dmytro Inosov, Nov 18 2024

Keywords

Comments

T(n,k) is defined as the number of distinct digit patterns (or digital types, as per A266946) of length n with k distinct digits such that all integers of that digital type share no common prime factor of a different digital type (as per A376918). Terms with k > n are omitted as trivial zeros.
To check whether a digit pattern of length n with k distinct digits A,B,... should be counted toward T(n,k), write that pattern as a linear combination of the form X1*A + X2*B + ..., where the pattern coefficients X1,X2,... consist of 0's and 1's (A007088), with 1's on positions of the corresponding digit in the pattern.
If GCD(X1,X2,...) has no prime divisors with a different digit pattern from the one we started from, the pattern is counted toward T(n,k). Otherwise, it is excluded.
For k = 10, the sum of all distinct digits A + B + ... + J = 45, which is divisible by 9. Hence, patterns in which all 10 distinct digits from A to J have the same number of occurrences in the pattern modulo 3 are identically divisible by 3 and should be excluded. This has an effect on T(n,10) whenever n takes the form 10m + 3q (with m >= 1 and q >= 0).
The digital types excluded in this way result in composites for any values of the distinct digits in the pattern, without the need to run primality tests on all numbers of that digital type individually.
The requirement for a divisor of a different digital type only affects terms with k=1, i.e. repdigits AA..AA, and acts to include that pattern iff the n-repunit is prime (n in A004023).
T(n,k) gives an upper bound for the number of contributions to A267013(n) with exactly k distinct digits.
Stirling numbers of the second kind S2(n,k) (A008277) give the total number of possible digital types of length n with k distinct digits and are therefore an upper bound for T(n,k).
T(n,1)=1 either when n=1 or when n is a term in A004023 (indices of prime repunits); otherwise T(n,1)=0 because all the repdigits A*(10^n-1)/9 are simultaneously divisibly by any proper divisor of the repunit (10^n-1)/9.
T(n,2) is nonmonotonic because a larger number of digit patterns is excluded whenever n has a large number of nontrivial divisors (A070824), resulting in anomalously low values, for example, for n=12 or n=18. This is a consequence of divisibility rules that are formulated for prime divisors of 10^r-1 or 10^r+1 (where r divides n) in terms of the sum or alternating sum of r-digit blocks, respectively [see S. Shirali, First Steps in Number Theory: A Primer on Divisibility, Universities Press, 2019, pp. 42-49].

Examples

			T(n,k) as a table (omitting terms with k > n):
---------------------------------------------------------------------------------------------
 k:  1,    2,      3,       4,       5,       6,       7,       8,      9,    10; | Total,
 n |                                                                              | A376918(n)
---------------------------------------------------------------------------------------------
 1 | 1;                                                                           |        1
 2 | 1,    1;                                                                     |        2
 3 | 0,    3,      1;                                                             |        4
 4 | 0,    4,      6,       1;                                                    |       11
 5 | 0,   15,     25,      10,       1;                                           |       51
 6 | 0,   12,     84,      65,      15,       1;                                  |      177
 7 | 0,   63,    301,     350,     140,      21,       1;                         |      876
 8 | 0,   80,    868,    1672,    1050,     266,      28,       1;                |     3965
 9 | 0,  171,   2745,    7770,    6951,    2646,     462,      36,      1;        |    20782
10 | 0,  370,   8680,   33505,   42405,   22827,    5880,     750,     45,     0; |   114462
11 | 0, 1023,  28501,  145750,  246730,  179487,   63987,   11880,   1155,    55; |   678568
12 | 0,  912,  69792,  583438, 1373478, 1322896,  627396,  159027,  22275,  1705; |  4160919
13 | 0, 3965, 261495, 2532517, 7508501, 9321312, 5715424, 1899612, 359502, 38610; | 27640938
... (for more terms, see the A-file).
The pattern "ABCA" is counted toward T(4,3) because ABCA = A*1001 + B*100 + C*10. Since GCD(1001,100,10) = 1, integers of the digital type "ABCA" (1021 in A266946) share no common prime factors.
The pattern "AA" is counted toward T(2,1) because AA = A*11, and 11 is a prime repunit. The only common prime factor shared by the repdigits "AA" is 11, which is of the same digital type as the original pattern. Since no other patterns with n=2 and k=1 exist, T(2,1)=1.
The pattern "ABAB" is not counted toward T(4,2) because it is divisible by 101 for any A > 0 and B >= 0, and 101 has a different digital type from ABAB. Indeed, ABAB = A*1010+B*101, which is identically divisible by 101. Since there are two more patterns "ABBA" and "AABB" that are excluded due to divisibility by 11, T(4,1) = S2(4,2) - 3 = 4.
The pattern "ABCDEFGHIJ" that contains all possible digits exactly once does not contribute to T(10,10) because its sum of digits is 1+2+...+9 = 45, which is divisible by 9. Therefore, all integers with the digital type "ABCDEFGHIJ" share the common prime factor 3. Since no other patterns with n=k=10 exist, T(10,10)=0.
The pattern "ABCBDEFBGHIBJ" is not counted toward T(13,10) because its sum of digits is 3*B+45, which is divisible by 3. In total there are binomial(13,4) = 715 patterns of length 13 with all 10 distinct digits in which any 4 digits are equal, and since A378761(13,10) = 0, we obtain T(13,10) = S2(13,10) - 715.
		

Crossrefs

Programs

  • Mathematica
    MinLength = 1; MaxLength = 10; (* the range of n to calculate T(n,k) for *)
    (* Function that calculates the canonical form A358497(n) *)
    A358497[k_] := FromDigits@a358497C[k]
    a358497C = Compile[{{k, _Integer}}, Module[{firstpos = ConstantArray[0, 10],
      digits = IntegerDigits[k], indx = 0}, Table[If[firstpos[[digits[[j]] + 1]] == 0, firstpos[[digits[[j]] + 1]] = Mod[++indx, 10]]; firstpos[[digits[[j]] + 1]], {j, Length[digits]}]]];
    (* Function that checks if a common prime factor of a different digital type exists *)
    DivisibilityRulesQ[pat_] := (
      If[Divisible[Length[pat], 10] && Length[Counts[pat]] == 10 &&
         AllTrue[Table[Counts[pat][[i]] == Length[pat]/10, {i, 1, 10}], TrueQ], Return[True]];
      (# != 1) && AnyTrue[Extract[# // FactorInteger, {All, 1}],
         A358497[#] != A358497[pat // FromDigits] &] &[
         Apply[GCD, Total[10^(Position[Reverse[pat], #]-1) // Flatten]& /@
         Mod[Range[CountDistinct[pat]], 10]]]);
    (* Function that generates all patterns that do not satisfy divisibility rules *)
    Patterns[len_, k_] := (
      Clear[dfs];
      ResultingPatterns = {};
      dfs[number_List] := If[Length[number] == len,
        If[Length[Union[If[# < 10, #, 0] & /@ number]] == k,
          AppendTo[ResultingPatterns, If[# < 10, #, 0] & /@ number]],
        Do[If[i <= 10, dfs[Append[number, i]]], {i, Range[1, Last[Union[number]] + 1]}]];
      dfs[{1}];
      FromDigits /@ Select[ResultingPatterns, ! DivisibilityRulesQ[#] &]);
    (* Counting the patterns T(n, k) and their sum, A376918(n) *)
    Do[Print[{n, #, Sum[#[[m]], {m, 1, Length[#]}]}] &[Table[Length[Patterns[n, j]], {j, 1, Min[10, n]}]], {n, MinLength, MaxLength}];

Formula

Sum_{k=1..min(n,10)} T(n,k) = A376918(n) (row sums).
T(n+1,n) = A000217(n) for n <= 10.
T(n,2) = 2^(n-1) - A378511(n) for n > 1.
T(n,k) <= S2(n,k) -- k'th column of A008277.
T(n,k) = S2(n,k) - A378761(n,k) for 2 <= k <= 9.
T(n,k) = S2(n,k) for n/2 < k <= 9.
T(n,k) = S2(n,k) for 2 <= k <= 9 if A378511(n) = 1 (see A378761).
T(n,10) = S2(n,10) for n = 11, 12, 14, 15, 17, 18 -- the only integers >= 10 for which no representation n = 10m + 3q with m >= 1 and q >= 0 exists and A378761(n,10)=0.
T(13,10) = S2(13,10) - binomial(13,4).
T(16,10) = S2(16,10) - binomial(16,7) - binomial(16,4)*binomial(12,4)/2.
T(19,10) = S2(19,10) - binomial(19,10) - binomial(19,7)*binomial(12,4) - binomial(19,4)*binomial(15,4)*binomial(11,4)/6.
T(23,10) = S2(23,10) - binomial(23,5)*Product_{i=1..8}(2n+1) -- since A378761(23,10)=0.

A267013 Number of distinct digital types of n-digit primes in base 10.

Original entry on oeis.org

1, 2, 4, 11, 51, 177, 876, 3965, 20782, 114459, 678536, 4160910, 27640731
Offset: 1

Views

Author

Keywords

Comments

The sequence is related to A266991.
Sequence {A164864(n) - a(n)}_(n>=1) begins 0,0,1,4,1,26,1,175,365,1516,...
One can explain, why, for example, a(4)=11, instead of A164864(4)=15. There exist exactly 4 types of 4-digit numbers, which cannot be prime. In A266946 these types are: 1001, 1010, 1100, 1111. Indeed, numbers abba,aabb,aaaa are divisible by 11; a number abab is divisible by 101.
In other cases of n-digit types we should verify the divisibility of numbers of types in A266946 at least by primes of the form 11,101,... Besides, a digital type 1...1 exists only for n in A004023, i.e., for only 9 values of n from the first 270343. This simplifies the calculations.
a(n) <= A376918(n) with equality for n <= 9, but thereafter some digital types which pass the divisibility rules of A376918 don't in fact occur among the primes (see A377727). - Dmytro Inosov, Nov 05 2024
Based on the conjectured terms in A377727, the next three terms can be conjectured: a(14)=190402538; a(15)=1378294708; a(16)=10437142874. - Dmytro Inosov, Jan 07 2025

Crossrefs

Formula

a(n) = A376918(n) - A377727(n). - Dmytro Inosov, Nov 05 2024

Extensions

a(11)-a(13) from Michael S. Branicky, Nov 04 2024

A377727 Number of digit patterns of length n that satisfy no divisibility rules but do not generate primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 9, 207
Offset: 1

Views

Author

Dmytro Inosov, Nov 05 2024

Keywords

Comments

Digit patterns (or digital types) are as per A266946.
The divisibility rules are per A376918 and they act to exclude patterns which always result in composite numbers, just due to the pattern.
There are A376918(n) remaining patterns but not all of them actually contain primes, and a(n) is how many of them do not, so that a(n) = A376918(n) - A267013(n).
We call these digital types primonumerophobic and a(n) is the number of these of length n.
It is conjectured that the next terms are a(14)=362, a(15)=363, a(16)=1448. This is based on the calculated number of primonumerophobic digit patterns with only 2 or 3 distinct digits and the vanishingly small combinatorial probability for the existence of additional primonumerophobic digit patterns of this length with 4 or more distinct digits.

Examples

			For n=10, the a(10) = 3 primonumerophobic patterns of length 10, which are also the smallest which exist, are
    pattern        A266946
   ----------     ----------
   AAABBBAAAB     1110001110
   AABABBBBBA     1101000001
   ABAAAAABBB     1011111000
These patterns have 2 distinct digits (A and B) so that there are in total 81 numbers of each pattern that all happen to be composite despite the pattern coefficients in each having no common divisors.
		

Crossrefs

Formula

a(n) = A376918(n) - A267013(n).

Extensions

a(13) = 207 confirmed by Dmytro Inosov, Dec 23 2024

A164904 a(n) is the number of palindromic structures using a maximum of ten different symbols.

Original entry on oeis.org

1, 1, 1, 2, 2, 5, 5, 15, 15, 52, 52, 203, 203, 877, 877, 4140, 4140, 21147, 21147, 115975, 115975, 678569, 678569, 4213530, 4213530, 27641927, 27641927, 190829797, 190829797, 1381367941, 1381367941, 10448276360, 10448276360, 82285618467
Offset: 0

Views

Author

Tanya Khovanova, Aug 30 2009

Keywords

Comments

a(n) is the number of palindromic word structures of length n using 10-ary alphabet.
a(n) is the same as taking every element twice from A164864.

Examples

			Four-digit palindromes have two different digits structures: aaaa and abba. Hence a(4)=2.
		

Crossrefs

Formula

G.f.: (148329*x^17 -403200*x^16 -210253*x^15 +732960*x^14 +122692*x^13 -557864*x^12 -38365*x^11 +233100*x^10 +6965*x^9 -58674*x^8 -736*x^7 +9135*x^6 +42*x^5 -861*x^4 -x^3 +45*x^2 -1) / ((x -1)*(2*x -1)*(2*x +1)*(2*x^2 -1)*(3*x^2 -1)*(5*x^2 -1)*(6*x^2 -1)*(7*x^2 -1)*(8*x^2 -1)*(10*x^2 -1)). [Colin Barker, Dec 05 2012]
Showing 1-10 of 12 results. Next