login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A157182 Square array such that horizontal and vertical neighbors add to a prime, read by antidiagonals, filled the greedy way using positive integers, not more than once each. 1

%I #14 Jan 02 2023 12:30:47

%S 1,2,4,3,9,7,8,10,22,6,5,21,19,25,11,12,26,40,18,36,20,17,35,27,13,23,

%T 47,33,14,24,32,16,30,50,56,28,15,29,65,51,31,53,57,45,39,38,44,42,62,

%U 52,48,74,82,34,58,41,59,95,89,75,49,83,99,55,69,43,60,68,54,78,92,64

%N Square array such that horizontal and vertical neighbors add to a prime, read by antidiagonals, filled the greedy way using positive integers, not more than once each.

%C Following ideas from _Leroy Quet_, D. Wilson and F. Adams-Watters, cf. link.

%C Can we conjecture that this is a permutation of the positive integers?

%H D. Wilson and F. Adams-Watters in reply to _Leroy Quet_, <a href="http://list.seqfan.eu/oldermail/seqfan/2009-February/000981.html">Prime Sums In A Grid</a>, SeqFan list, Feb 24 2009

%e The antidiagonals of the array form the following triangle, where each number must add up to a prime with its neighbors above:

%e ____________________________ 1,

%e __________________________ 2 , 4,

%e ________________________ 3 , 9 , 7,

%e ______________________ 8, 10 , 22 , 6,

%e ____________________ 5, 21 , 19 , 25 , 11,

%e _________________ 12, 26 , 40 , 18 , 36 , 20,

%e _______________ 17, 35 , 27 , 13 , 23 , 47 , 33,

%e _____________ 14, 24 , 32 , 16 , 30 , 50 , 56 , 28,

%e ___________ 15, 29 , 65 , 51 , 31 , 53 , 57 , 45 , 39,

%e _________ 38, 44 , 42 , 62 , 52 , 48 , 74 , 82 , 34 , 58,

%e _______ 41, 59 , 95 , 89 , 75 , 49 , 83 , 99 , 55 , 69 , 43,

%e _____ 60, 68 , 54 , 78 , 92 , 64 , 90, 80 , 94 , 112, 70 , 46,

%e ___ 37, 71 , 113, 73, 101 , 87 , 67, 77, 117 , 79 , 61 , 81 , 63,

%e _ 66, 102, 86 , 84, 126, 110, 106, 72, 116, 154 , 88 , 76, 100, 104,

%e 85, 91, 125, 107, 97, 131, 123, 121, 155, 153, 103, 105, 151, 93, 119

%o (PARI) A157182( n, show=0/*set to 1 to print everything instead*/, last_diag=[1], min_not_used=2, others_used=[])={ local(new_diag); n-- | return(1); for( d=1+#last_diag,1+sqrtint(2*n), /* fill the d-th antidiagonal */ show & print(last_diag,","); new_diag=vector( d ); for( j=1,d, ! new_diag[ j ] && new_diag[ j ] = min_not_used + (d-min_not_used)%2; while( setsearch( others_used, new_diag[j] ) | ( j > 1 && setsearch( Set( vecextract( new_diag, 2^(j-1)-1)), new_diag[j] )) | ( j < d && ! isprime( last_diag[ j ] + new_diag[ j ] )) | ( j > 1 && ! isprime( last_diag[ j-1 ] + new_diag[ j ] )), new_diag[j] += 2; ); show | n-- | return(new_diag[j]) ); others_used = setunion( others_used, new_diag ); while( setsearch( others_used, min_not_used ), others_used = setminus( others_used, Set( min_not_used )); min_not_used++; ); last_diag=new_diag; /* a=concat(a, new_diag ); */ ); [ min_not_used, others_used ];}

%Y This is the 2D analog of A055265. [From _Franklin T. Adams-Watters_, Mar 07 2009]

%K nonn,tabl

%O 1,2

%A _M. F. Hasler_, Feb 24 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 06:24 EDT 2024. Contains 371918 sequences. (Running on oeis4.)